Bug fix to logging.