Fix bug with logging.