Properly test for NaN.