Fix JS asNumber method