Removed unused imports + other flake8 fixes.