Minor clean ups

Fixing some minor issues found with pylint.  I've done them in separate commits in case you don't want all ofg the fixes.  Feel free to squash if necessary.

I'm actually fairly certain this is a harmful change. When I get back to a computer and can double check, I'll post the exact case in which it is harmful.