Cleanups and some PEP8 fixes