Fixed several operators

I've changed several comparisons. According to PEP8 standard comparing objects with None (or any  singleton for that matter) should only look at object identity by using 'is' and 'is not' - see https://www.python.org/dev/peps/pep-0008/#programming-recommendations for more details