flake8 fixes

Via #331.