Fixed issue with identical SortKey fix

fixed the issue with identical sortkeys involving removal and recopying
of records.