Replace Number.isNaN with isNaN

Looks like Number.isNaN can be troublesome in some environments. It is better to use just plain isNaN instead.