Fix bugs with logger.