Fix equality test for double/none type