Core: Allow more than 2 arrays for merge function.