Minor improvements to error reporting in logging.