Tidied up logging.