Fix segment offset sorting.
Get rid of incorrect duplicate checks in index.