Fix printing of diagnostics messages.