Fixed crash where the array oldToNewIndexMap was accessed with oldGlobalIndex, a huge number that is out of range.