Flake fixes

pyflake fixes for PR #885