PEP8 and other style fixes.

I suggest you install some style-checking tool on the build such as `flake8`.