Fix pyflakes/pep8 errors