PEP compliance and code clean-up as suggested by codeq