Code cleanup, some PEP8 fixes