Fix many more bugs
Fix some pep8 violations I had introduced.