Fix a bunch of PEP8 issues spotted by flake8