Fix PEP8 W391 issues (blank line at end of file).
Fix PEP8 E712 issues (cmp to True should be ‘if cond is True:’ or ‘if cond:’)
Misc PEP8 fixes.