Minor cleanup and pyflakes/pep8