Changed how None is compared

PEP 8 states None should be compared as `is` and `is not` rather than
`=` or `!=`.