Fix printing of error messages