Clean up logging, fix python error.