Fixed exception when compared to None