Fixed comparison between NaN and object non-numeric value and moved
strict equality comparison to the top