Minor PEP8 and and idiomatic Python fixes