Fixed merging of multidimensional arrays