Fix most flake8 errors

review8771002