even more PEP8 compliance
fixed bugs introduced by refactoring