 			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] ];
-
+				{
+					loc.array = [this[loc.association]];
+				}
 				if (IsArray(loc.array))
-					for (loc.i = 1; loc.i lte ArrayLen(loc.array); loc.i++)
+				{
+					loc.iEnd = ArrayLen(loc.array);
+					for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
+					{
 						loc.array[loc.i].$resetToNew();
-			}
-		}
-	</cfscript>
-</cffunction>
-
-<cffunction name="$persistedOnInitialization" access="public" output="false" returntype="boolean">
-	<cfscript>
+					}
+				}
+			}
+		}
+	</cfscript>
+</cffunction>
+
+<cffunction name="$persistedOnInitialization" returntype="boolean" access="public" output="false">
+	<cfscript>
+		var loc = {};
 		if (StructKeyExists(variables.wheels.instance, "persistedOnInitialization") && variables.wheels.instance.persistedOnInitialization)
-			return true;
-	</cfscript>
-	<cfreturn false />
-</cffunction>
+		{
+			loc.rv = true;
+		}
+		else
+		{
+			loc.rv = false;
+		}
+	</cfscript>
+	<cfreturn loc.rv>
+</cffunction>
			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]];

							$setForeignKeyValues(missingMethodArguments=loc.array[loc.i], keys=loc.info.foreignKey);
						}
						loc.saveResult = $invoke(componentReference=loc.array[loc.i], method="save", invokeArgs=arguments);
						if (loc.rv)
						{
							// don't change the return value when we have already received a false
							loc.rv = loc.saveResult;
						}
					}
