STY: Fix flake8 errors

Most of them were very minor, fixes #547.