Improved the logging.