Fixup misc flake8 errors and problems

Probably resolves some minor bugs as well.
Merge pull request #7 from javacruft/wip-autopep8

Fixup misc flake8 errors and problems