fix possible NULL pointer in '%c' callout substitution and cleanup '%D' debug text thanks, Kay