Pyflakes integration

Pyflakes integration (also includes previous fixes)