Bunch of pep8 and pyflakes fixes.