 			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", false);
+				StructDelete(loc.arguments, "key");
 				return $invoke(componentReference=loc.model, method="new", invokeArgs=loc.arguments);
 			}
 			else if (Len(loc.arguments.key) && loc.delete && arguments.association.nested.delete && arguments.delete)

				variables.wheels.class.associations[loc.association].nested.autoSave = arguments.autoSave;
				variables.wheels.class.associations[loc.association].nested.sortProperty = arguments.sortProperty;
				variables.wheels.class.associations[loc.association].nested.rejectIfBlank = $listClean(arguments.rejectIfBlank);
				// add to the white list if it exists
				if (StructKeyExists(variables.wheels.class.accessibleProperties, "whiteList"))
					variables.wheels.class.accessibleProperties.whiteList = ListAppend(variables.wheels.class.accessibleProperties.whiteList, loc.association, ",");
			}
			else if (application.wheels.showErrorInformation)
			{

		{
			loc.sortedArray = [];
			loc.iEnd = ArrayLen(this[arguments.property]);
			for (loc.i=1; loc.i <= 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 = "";
