 		var g:GroupBase = GroupBase(target);
 	    if (!g)
 	        return 0.0;
+	        
+	    if ((index < 0) || (index >= g.numLayoutItems))
+	       return 0.0;
 	        
         var li:ILayoutItem = g.getLayoutItemAt(index);
         if ((li == null) || !li.includeInLayout)


        setIndexInView(i0, i1);
    }
    
   /**
    *  Returns the actual position/size Rectangle of the first non-null
    *  includeInLayout item, beginning with the item at index i.  
    * 
    *  Returns null if no such item can be found.
    *  
    *  @private
    */
    private static function findLayoutItemBounds(g:GroupBase, i:int, dir:int):Rectangle
    {
    	var n:int = g.numLayoutItems;
    	while((i >= 0) && (i < n))
    	{
    	   var item:ILayoutItem = g.getLayoutItemAt(i);
    	   if (item && item.includeInLayout)
    	   {
	           var p:Point = item.actualPosition;
	           var s:Point = item.actualSize; 
	           return new Rectangle(p.x, p.y, s.x, s.y);   	   	
    	   }
    	   i += dir;
    	}
    	return null;
    }
    
    /**
     *  Overrides the default handling of UP/DOWN and 
     *  PAGE_UP, PAGE_DOWN. 

        var g:GroupBase = target;
        if (!g)
            return 0;     

        var maxIndex:int = g.numLayoutItems -1;
        if (maxIndex < 0)
            return 0;
