Fixed messages in event of logging issues + minor PEP-8