Fixed previousIndex from merge