Cleaning up logging.
Debug improvements.