Fix arity checking on relations