Fix some PEP8/pyflakes warnings