Fix comparison of NaN