Update flake8 conf and fix linting errors.

A pep8 / pyflakes update surfaced a few linting errors.
Merge pull request #894 from glogiotatidis/fixpep8

Update flake8 conf and fix linting errors.