Cleanup and more correct logging.