PEP8 fixes; cleanup NoneType comparisons