Fixing array merge problem