Some improvement of logging.