diff -Nur content_taxonomy/content_taxonomy_activeselect.module content_taxonomy.new/content_taxonomy_activeselect.module
--- content_taxonomy/content_taxonomy_activeselect.module	2007-03-06 11:10:08.000000000 -0800
+++ content_taxonomy.new/content_taxonomy_activeselect.module	2007-03-18 11:47:33.617376506 -0700
@@ -87,10 +87,10 @@
   
   switch ($op) {
     case 'prepare form values':
-      if (!$node_field) {
-        $node_field['default_tid'] = $_POST['edit'][$field['field_name']]['tid'];
-        $node_field['default_children'] = $_POST['edit'][$field['field_name']]['children'];
-        $node_field['default_grandchildren'] = $_POST['edit'][$field['field_name']]['grandchildren'];
+      if (!isset($node_field['default_tid']) ) {
+        $node_field['default_tid'] = $_POST[$field['field_name']]['tid'];
+        $node_field['default_children'] = $_POST[$field['field_name']]['children'];
+        $node_field['default_grandchildren'] = $_POST[$field['field_name']]['grandchildren'];
       }
       break;
     
@@ -104,16 +104,16 @@
         $default_children = implode(',', $node_field['default_children']);
       }
       else {
-        $default_children = "";
+        $default_children = $node_field['default_children'];
       }
       $form[$field['field_name']] = array('#tree' => TRUE);         
       $form[$field['field_name']]['tid'] = array(
         '#title' => $field['widget']['label'],
         '#type' => 'activeselect',
         '#activeselect_path' => 'content_taxonomy/activeselect',
-        '#activeselect_targets' =>  $field['field_name'] .'-children',
-        '#activeselect_extra' => 'term,'. FALSE .','. $field['vid'] .','. $field['field_name'] .'-children#'. $default_children,
-        '#default_value' => isset($node_field['default_tid']) ? array_values($node_field['default_tid']) : array(),
+        '#activeselect_targets' =>  str_replace('_', '-', $field['field_name']) .'-children',
+        '#activeselect_extra' => 'term,'. FALSE .','. $field['vid'] .','. str_replace('_', '-', $field['field_name']) .'-children@'. $default_children,
+        '#default_value' => isset($node_field['default_tid']) ? $node_field['default_tid'] : "",
         '#options' => $options_terms,
         '#required' => $field['required'],
         '#DANGEROUS_SKIP_CHECK' => TRUE,
@@ -135,13 +135,13 @@
           $default_grandchildren = implode(',', $node_field['default_grandchildren']);
         }
         else {
-          $default_grandchildren = "";
+          $default_grandchildren = $node_field['default_grandchildren'];
         }
       
         $form[$field['field_name']]['children']['#type'] = 'activeselect';
         $form[$field['field_name']]['children']['#activeselect_path'] = 'content_taxonomy/activeselect';
-        $form[$field['field_name']]['children']['#activeselect_targets'] = $field['field_name']. '-grandchildren';
-        $form[$field['field_name']]['children']['#activeselect_extra'] = 'term,'. FALSE .','. $field['vid'] .','. $field['field_name']. '-grandchildren#'. $default_grandchildren;
+        $form[$field['field_name']]['children']['#activeselect_targets'] = str_replace('_', '-', $field['field_name']) .'-grandchildren';
+        $form[$field['field_name']]['children']['#activeselect_extra'] = 'term,'. FALSE .','. $field['vid'] .','. $field['field_name']. '-grandchildren@'. $default_grandchildren;
             
         $form[$field['field_name']]['grandchildren'] = array(
           '#title' => $field['widget']['label_grandchildren'],
@@ -152,39 +152,28 @@
         );
       }
       return $form;
+      break;
           
       case 'process form values':       
-        if (is_array($node_field['tid'])) {
-          foreach ($node_field['tid'] as $tid) {
-            $node_field['tids'][] = $tid;
-          }
-        }
-        elseif (isset($node_field['tid'])) {
+      if ($node_field['tid'] > 0 ) {
+        $node_field['tids']= array();
           $node_field['tids'][] = $node_field['tid'];
         }
         unset($node_field['tid']);
         
-        if (is_array($node_field['children'])) {
-          foreach ($node_field['children'] as $tid) {
-            $node_field['tids'][] = $tid;
-          }
-        }
-        elseif (isset($node_field['children'])) {
+      if ($node_field['children'] > 0) {
+        $node_field['tids']= array();
           $node_field['tids'][] = $node_field['children'];
         }
         unset($node_field['children']);
         
-        if (is_array($node_field['grandchildren'])) {
-          foreach ($node_field['grandchildren'] as $tid) {
-            $node_field['tids'][] = $tid;
-          }
-        }
-        elseif (isset($node_field['grandchildren'])) {
+      if ($node_field['grandchildren'] > 0) {
+        $node_field['tids']= array();
           $node_field['tids'][] = $node_field['grandchildren'];
         }
         unset($node_field['grandchildren']);
+      break;
       }
-  
 }
 
 /**
@@ -210,7 +199,6 @@
   if (empty($source) || empty($targets) || empty($string)) {
     exit();
   }
-  
   $targets = explode(',', $targets);
   
   $extras = explode(',',$extra); 
@@ -219,7 +207,7 @@
   $default_vid = $extras[2];
   for ($i=2; $i<count($extras); $i++) {
     foreach ($targets as $target) {
-      if (strtok($extras[$i],'#') == $target) {
+      if (strtok($extras[$i],'@') == $target) {
         $default_tids[$target][] = drupal_substr($extras[$i],drupal_strlen($target)+1);
       }
     }
@@ -260,29 +248,28 @@
  * adding of terms when node is loaded (called by content_taxonomy)
  */
 function content_taxonomy_activeselect_field_load($op, &$node, $field, &$node_field, &$additions, $teaser, $page) {
-  $default_terms = content_taxonomy_terms_by_field($node, $field['vid'], $field['tid'],1);
-  $additions[$field['field_name']]['default_tid'] = array_keys($default_terms);
-  $default_terms = array_values($default_terms);
-  
-  $children_terms = content_taxonomy_terms_by_field($node, $field['vid'], $default_terms[0]->tid,1);
-  if (is_array($children_terms)) {
-    foreach ($children_terms as $term) {
-      $additions[$field['field_name']]['tid'][$term->tid] = $term;
-    }
-    $additions[$field['field_name']]['default_children'] = array();
-    $additions[$field['field_name']]['default_children'] = array_keys($children_terms); 
-    $children_terms = array_values($children_terms);
+
+  //Grab all the taxonomy entries for this particular vocabulary (vid)
+  $default_terms = array_keys(taxonomy_node_get_terms_by_vocabulary($node->nid, $field['vid']));
+
+  //Now grab the taxonomy hierarchy back up to the root
+  $parents=taxonomy_get_parents_all($default_terms[0]);
+
+  //Set the defaults
+  $level_names=array(
+    '0' => 'tid',
+    '1' => 'children',
+    '2' => 'grandchildren');
     
     if ($field['widget']['grandchildren']) {
-      $grandchildren_terms = content_taxonomy_terms_by_field($node, $field['vid'], $children_terms[0]->tid,1);
-      if (is_array($grandchildren_terms)) {
-        foreach ($grandchildrenchildren_terms as $term) {
-          $additions[$field['field_name']]['tid'][$term->tid] = $term;
-        }
-        $additions[$field['field_name']]['default_grandchildren'] = array();
-        $additions[$field['field_name']]['default_grandchildren'] = array_keys($grandchildren_terms);
+    $levels=min(2,count($parents)-1);
       }
+  else {
+    $levels=min(1,count($parents)-1);
     }
+
+  for ($count=0;$count<=$levels;$count++) {
+    $additions[$field['field_name']]['default_'.$level_names[$levels-$count]] = $parents[$count]->tid;
   }
 }
 ?>
\ No newline at end of file
diff -Nur content_taxonomy/content_taxonomy.module content_taxonomy.new/content_taxonomy.module
--- content_taxonomy/content_taxonomy.module	2007-03-09 09:01:52.000000000 -0800
+++ content_taxonomy.new/content_taxonomy.module	2007-03-18 11:47:33.617376506 -0700
@@ -126,23 +126,22 @@
       return $additions;
       break;
       
-    case 'update':
+    case 'submit':
       global $cleared;
       if (!is_array($cleared[$node->nid][$field['vid']]) || !$cleared[$node->nid][$field['vid']]) {
         content_taxonomy_clear_taxonomy_array($node, $field['vid']);
         $cleared[$node->nid][$field['vid']] = true;
       }
       
-    case 'insert':
       if (isset($field['save']) && $field['save'] != 'cck_table') {
         if (is_array($node_field['tids'])) {
           foreach ($node_field['tids'] as $tid) {
-            $node->taxonomy[$tid] = $tid;
+            $node->taxonomy[$tid] = taxonomy_get_term($tid);
           }
         }
         elseif (is_array($node_field) && $field['save'] == 'both') {
           foreach ($node_field as $tid => $value) {
-            $node->taxonomy[$tid] = $tid;
+            $node->taxonomy[$tid] = taxonomy_get_term($tid);
           }
         }       
       }
