Some small changes to increase logging and code all PEP8 compliant