Fixed several flake8 errors