[lua] Added argument arity check to template wrapper