Enhancing error logging.