[BUGFIX] Avoid duplicates if ReferenceIndex is unable to finish