         
         for (var index:int = 0; index < newVisibleElementCount; index++) 
         {
-            var newEltIndex:int = (index < newVisibleIndices.length) ? newVisibleIndices[index] : index;
+            var newEltIndex:int = newVisibleIndices[index];
             if (newEltIndex == lastIndex)
+            {
+                newVisibleElements.length = index;
                 break;
+            }
             
             // If an element already exists for visibleIndex then use it, otherwise create one
             
             var eltOffset:int = oldVisibleIndices.indexOf(newEltIndex);
-            var elt:IVisualElement = (eltOffset != -1) ? oldVisibleElements[eltOffset] : null;
+            var elt:IVisualElement = (eltOffset != -1 && eltOffset < oldVisibleElements.length) ? oldVisibleElements[eltOffset] : null;
             if (elt == null)
                 elt = allocateGridElement(factory);
             

        rowIndex:int,
        columnIndex:int):IVisualElement
    {
        if (rowIndex == -1 || grid.selectionMode == GridSelectionMode.NONE)
        {
            if (indicator)

        
        freeItemRenderers(visibleItemRenderers);
        
        clearSelectionIndicators();
        
        freeGridElement(hoverIndicator)
        hoverIndicator = null;
