Better isNaN check