Pyflakes fixes

Things that couldn't work before
Fix shebang
Merge pull request #2 from laurentb/master

Various fixes