=== modified file 'includes/form.inc'
--- includes/form.inc	
+++ includes/form.inc	
@@ -333,12 +333,9 @@ function form_builder($form_id, $form) {
 
     $posted = (isset($_POST['edit']) && ($_POST['edit']['form_id'] == $form_id));
     $edit = $posted ? $_POST['edit'] : array();
-    $ref =& $form_values;
     foreach ($form['#parents'] as $parent) {
       $edit = isset($edit[$parent]) ? $edit[$parent] : NULL;
-      $ref =& $ref[$parent];
     }
-    $form['#ref'] = &$ref;
     if (!isset($form['#value']) && !array_key_exists('#value', $form)) {
       if ($posted) {
         switch ($form['#type']) {
@@ -402,7 +399,7 @@ function form_builder($form_id, $form) {
   // We call this after #process gets called so that #process has a
   // chance to update #value if desired.
   if (isset($form['#input']) && $form['#input']) {
-    $ref = $form['#value'];
+    $form = form_set_value($form);
   }
 
   // Recurse through all child elements.
@@ -436,6 +433,29 @@ function form_builder($form_id, $form) {
   return $form;
 }
 
+function form_set_value($form, $value = NULL) {
+  global $form_values;
+  if (isset($value)) {
+    $form['#value'] = $value;
+  }
+  _form_set_value($form_values, $form, $form['#parents']);
+  return $form;
+}
+
+function _form_set_value(&$form_values, $form, $parents) {
+  $parent = array_shift($parents);
+  if (empty($parents)) {
+    $form_values[$parent] = $form['#value'];
+  }
+  else {
+    if (!isset($form_values[$parent])) {
+      $form_values[$parent] = array();
+    }
+    _form_set_value($form_values[$parent], $form, $parents);
+  }
+  return $form;
+}
+
 /**
  * Renders a HTML form given a form tree. Recursively iterates over each of
  * the form elements, generating HTML code. This function is usually
