Comprehensive fixes for pep8 and flake8.