Pyflakes fixes

Fixes all errors found via pyflakes.