Fix arity calculation.