Fix most flake8 issues