Fix buggy logging.