Update flake8 conf and fix linting errors.

A pep8 / pyflakes update surfaced a few linting errors.