                     // client, no need to search the entire list, just check to see
                     // if the client exists in the queue (it would be the only item
                     // at that nestLevel).
-                    if (arrayOfDictionaries[min].items[client])
+                    if (bin.items[client])
                     {
                         removeChild(ILayoutManagerClient(client), min);
                         return client;

     */
    private function addDictionary(d:Dictionary, length:int, priority:int):void
    {
        arrayOfDictionaries[priority] = { length: length, items: d };
        // Update our min and max priorities.
        if (maxPriority < minPriority)
        {


        if (minPriority <= maxPriority)
        {
            var bin:PriorityBin = priorityBins[minPriority];
            while (!bin || bin.length == 0)
            {
                minPriority++;
                if (minPriority > maxPriority)
                    return null;
                bin = priorityBins[minPriority];
            }           

            // Remove the item with smallest priority from our priority queue.
            // Must use a for loop here since we're removing a specific item
            // from a 'Dictionary' (no means of directly indexing).
            for (var key:Object in bin.items )
            {
                obj = key;
                removeChild(ILayoutManagerClient(key), minPriority);
                break;
            }

            // Update minPriority if applicable.
            while (!bin || bin.length == 0)
            {
                minPriority++;
                if (minPriority > maxPriority)
                    break;
                bin = priorityBins[minPriority];
            }           
        }

