Flake8 complicance

These changes have not been tested, it might have broken something.