Fixed index offset bug in merging repo