Fix NUM2INT on retun value type