Bring into PEP8 compliance and a few Pythonic tweaks