Fixed a number of flake8 errors -- particularly around unused imports and local variables
Fixed this syntax error on py32