Fixed most flake8 errors