Optimization: inline isNullOrNan. Also, don't bother calling isNaN just to test NaN...