fix flake8 errors

Fixes #180.

Can someone double check - these are not tested pieces of code!