Fix error logging.