add arity checking and native type tests