Fixed bug using ==None rather than is None.