PEP8 and other minor tweaks