Fix python linter

Fixes issue #512
And updates pyflakes.

This was not a pep8 error, was a pyflakes error.