 					// If the object specified in newState does not exist in oldState, we don't need to do anything further.
 					// If the class is the same as before, then we can save a diff instead of the entire session state.
 					// If the class changed, we can't save only a diff -- we need to keep the entire session state.
-					// Replace the sessionState in the new DynamicState object with the diff.
 					if (oldTypedState != null && oldTypedState[DynamicState.CLASS_NAME] == className)
 					{
+						// Replace the sessionState in the new DynamicState object with the diff.
 						className = null; // no change
 						diffValue = computeDiff(oldTypedState[DynamicState.SESSION_STATE], sessionState);
 						if (diffValue === undefined)

				{
					if (StandardLib.compare(oldState, newState) == 0)
						return undefined; // no diff
					return newState;
				}
				
				// create an array of new DynamicState objects for all new names followed by missing old names

					{
						if (!diff)
							diff = {};
						if (newState.hasOwnProperty(oldName))
							diff[oldName] = diffValue;
						else
							diff[oldName] = undefined; // property was removed
					}
				}

