Fixed some flake8 warnings and uncovered a non-running test.