Fixing isNaN edge case. Fixed according to the spec ecma 262 5.1