Several minor style changes to follow PEP 8 (other than E501). Mainly comparison to None, and doc string.