         {
 			// Check what locales are not already loaded
             // and push them preserving the order.
-			for (j = 0, k = locales.length; j < k; j++)
+			for (j = 0; j < noLocales; j++)
             {
 				promote(locales[j]);
 			}

		
		var i:int;
        var j:int;
        var k:int;
        var l:int;
		var locale:String;
		
		var locales:Array = trimAndNormalize(appLocales);
		var preferenceLocales:Array	= trimAndNormalize(systemPreferences);
		
		addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale);
		
		// For better performance, save the locales in a lookup table.
		for (j = 0; j < locales.length; j++)
        {
			hasLocale[locales[j]] = j;
		}

	//  Methods
	//
	//--------------------------------------------------------------------------

    /**
     *  @private
     */
    public function clone():LocaleID {

       var copy:LocaleID = new LocaleID();
       copy.lang = lang;
       copy.script = script;
       copy.region = region;
       copy.extended_langs = extended_langs.concat();
       copy.variants = variants.concat();
       copy.extensions = {};
       for (var i:String in extensions)
       {
           if (extensions.hasOwnProperty(i))
           {
           	    copy.extensions[i] = extensions[i].concat();
           }
       }
           
        copy.privates = privates.concat();
        copy.privateLangs = privateLangs;
    
        return copy;
    }

	/**
     *  @private
