PEP8 generated code compliance, bugfixes