Fix comparison to Double.NaN

Equality comparison to these values is always false