ArrayIndexOutOfBounds during merge in some rare cases