Pyflakes fixes

Things that couldn't work before
Fix shebang