common modules: tidy up to meet PEP8 better
Merge pull request #2611 from felixonmars/common-tidy

PEP8 fixes to various common modules. Fixes #2611.