 				return FLAG_BYTES;
 			if (source is Boolean)
 				return FLAG_BOOLEAN;
-			
-			return FLAG_OBJECT;
+			if (getQualifiedClassName(source) == "Object")
+				return FLAG_OBJECT;
+			
+			return FLAG_CUSTOM;
 		}
 		
 		public static function encode(source : *) : ByteArray

														   decodeString,
														   decodeUTFString,
														   decodeBytes,
														   decodeBoolean];
		
		private static function getTypeFlag(source : *) : int
		{

		private static const FLAG_UTF_STRING	: int		= 5;
		private static const FLAG_BYTES			: int		= 6;
		private static const FLAG_BOOLEAN		: int		= 7;
		private static const FLAG_CUSTOM		: int		= 8;
		
		private static const ENCODERS		: Array		= [encodeObject,
														   encodeArray,
