Topic/minor cleanup

Cleanup some stuff from previous PRs, pyflakes, etc.