fix a bunch of PEP8 & pyFlakes warnings