Merge pull request #823 from jmaas/master

More code cleanup as result of pyflakes