pyflakes: Remove unused imports and fix warnings