Correct error message logging.