Fix some arity tests and bugs