Making tests work with tox and pyenv
Fix flake8 warnings