 			loc.arguments.key = $createPrimaryKeyList(params=arguments.value, keys=loc.model.primaryKey());
 
 			if (IsObject(arguments.value))
-			{
 				loc.object = arguments.value;
-			}
 			else if (Len(loc.arguments.key))
-			{
 				loc.object = loc.model.findByKey(argumentCollection=loc.arguments);
-			}
+
 			if (StructKeyExists(arguments.value, "_delete") && IsBoolean(arguments.value["_delete"]) && arguments.value["_delete"])
-			{
 				loc.delete = true;
-			}
+
 			if (!IsObject(loc.object) && !loc.delete)
 			{
-				StructDelete(loc.arguments, "key");
+				StructDelete(loc.arguments, "key", false);
 				return $invoke(componentReference=loc.model, method="new", invokeArgs=loc.arguments);
 			}
 			else if (Len(loc.arguments.key) && loc.delete && arguments.association.nested.delete && arguments.delete)

			if (loc.associations[loc.association].nested.allow && loc.associations[loc.association].nested.autoSave && StructKeyExists(this, loc.association))
			{
				loc.array = this[loc.association];
				if (IsObject(this[loc.association]))
				{
					loc.array = [ this[loc.association] ];
				}
				if (IsArray(loc.array))
				{
					loc.iEnd = ArrayLen(loc.array);
					for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
					{
						$invoke(componentReference=loc.array[loc.i], method="valid");
					}
				}
			}
		}
	</cfscript>
	<cfreturn true>
</cffunction>

<cffunction name="$saveAssociations" returntype="boolean" access="public" output="false">
	<cfargument name="parameterize" type="any" required="true">
	<cfargument name="reload" type="boolean" required="true">
	<cfargument name="validate" type="boolean" required="true">
	<cfargument name="callbacks" type="boolean" required="true">
	<cfscript>
		var loc = {};
		loc.rv = true;

				}
			}
		}
		// sort the order of the objects in the array if the property is set
		if (Len(arguments.association.nested.sortProperty))
		{
			loc.sortedArray = [];
			loc.iEnd = ArrayLen(this[arguments.property]);

			for (loc.i=1; loc.i lte loc.iEnd; loc.i++)
			{
				if (!IsNumeric(this[arguments.property][loc.i][arguments.association.nested.sortProperty]))
					return;
				loc.sortedArray[this[arguments.property][loc.i][arguments.association.nested.sortProperty]] = this[arguments.property][loc.i];
			}

			this[arguments.property] = loc.sortedArray;
		}
	</cfscript>
	<cfreturn />
</cffunction>

<cffunction name="$updateCollectionObject" returntype="void" output="false" access="public">
	<cfargument name="property" type="string" required="true" />
	<cfargument name="value" type="struct" required="true" />
	<cfargument name="position" type="numeric" required="false" default="0" />
	<cfscript>
		var loc = {};
		if (!arguments.position)
			arguments.position = ArrayLen(this[arguments.property]);
		if (IsObject(this[arguments.property][arguments.position]))
			this[arguments.property][arguments.position].setProperties(properties=arguments.value);
		else
			ArrayDeleteAt(this[arguments.property], arguments.position);
	</cfscript>
</cffunction>

<cffunction name="$getAssociationObject" returntype="any" access="public" output="false">
	<cfargument name="property" type="string" required="true" />
	<cfargument name="value" type="struct" required="true" />
	<cfargument name="association" type="struct" required="true" />
	<cfargument name="delete" type="boolean" required="true" />
	<cfscript>
		var loc = {};
		loc.method = "";
