CORE: add arity check to apply.