moved application arity checking to apply.h and increased max arity to 15