Merge pull request #274 from Kwpolska/master

Reformatting with Flake8
fix tests
flake8 fix
further flake8 refinements

Signed-off-by: Kwpolska <kwpolska@gmail.com>