Fixed bug with logging.