Use 'is' to compare with None

Issues were detected by PyCharm Community Edition 3.4.