Oops, add number check when checking for NaN.