 		{
 			keyType = keyType == null ? null : String(keyType);
 			
-			// get mapping of key strings to QKey weak references
 			var map_localName_qkey:Object = map_keyType_localName_qkey.map.get(keyType);
 			if (!map_localName_qkey)
 				map_localName_qkey = init_map_localName_qkey(keyType);
+			keyType = StandardLib.trim(keyType);
 			
 			if (!csvParser)
 				csvParser = new CSVParser(false, DELIMITER);

		private function init_map_localName_qkey(keyType:String):Object
		{
			// key type not seen before, so initialize it
			var map_localName_qkey:Object = new JS.Map();
			map_keyType_localName_qkey.map.set(keyType, map_localName_qkey);
			return map_localName_qkey;
		}

			for (var i:int = iStart; i < iEnd; i++)
			{
				var localName:String = String(keyStrings[i]);
				var qkey:QKey = map_localName_qkey.get(localName);
				if (!qkey)
				{
					var trimmedLocalName:String = StandardLib.trim(localName);
					qkey = map_localName_qkey.get(trimmedLocalName);
					if (!qkey)
					{
						var qkeyString:String;
						if (keyType)
							qkeyString = csvParser.createCSVRow([keyType, trimmedLocalName]);
						else
							qkeyString = trimmedLocalName;
						
						qkey = new QKey(keyType, trimmedLocalName, qkeyString);
						
						map_localName_qkey.set(trimmedLocalName, qkey);
						map_qkeyString_qkey.set(qkeyString, qkey);
						array_numberToQKey[qkey.toNumber()] = qkey;
						map_qkey_keyType.set(qkey, keyType);
						map_qkey_localName.set(qkey, trimmedLocalName);
					}
					if (localName != trimmedLocalName)
						map_localName_qkey.set(localName, qkey);
				}
				
				output[i] = qkey;
