Index: modules/forum/forum.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.admin.inc,v
retrieving revision 1.29
diff -u -p -r1.29 forum.admin.inc
--- modules/forum/forum.admin.inc	9 Jan 2010 12:51:01 -0000	1.29
+++ modules/forum/forum.admin.inc	8 Mar 2010 07:37:59 -0000
@@ -93,6 +93,8 @@ function forum_form_submit($form, &$form
       break;
     case SAVED_UPDATED:
       drupal_set_message(t('The @type %term has been updated.', array('%term' => $form_state['values']['name'], '@type' => $type)));
+      // Clear the page and block caches to avoid stale data.
+      cache_clear_all();
       break;
   }
   $form_state['redirect'] = 'admin/structure/forum';
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.95
diff -u -p -r1.95 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	7 Mar 2010 23:14:20 -0000	1.95
+++ modules/taxonomy/taxonomy.admin.inc	8 Mar 2010 07:38:01 -0000
@@ -791,6 +791,8 @@ function taxonomy_form_term_submit($form
     case SAVED_UPDATED:
       drupal_set_message(t('Updated term %term.', array('%term' => $term->name)));
       watchdog('taxonomy', 'Updated term %term.', array('%term' => $term->name), WATCHDOG_NOTICE, l(t('edit'), 'taxonomy/term/' . $term->tid . '/edit'));
+      // Clear the page and block caches to avoid stale data.
+      cache_clear_all();
       break;
   }
 
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.578
diff -u -p -r1.578 taxonomy.module
--- modules/taxonomy/taxonomy.module	5 Mar 2010 13:41:04 -0000	1.578
+++ modules/taxonomy/taxonomy.module	8 Mar 2010 07:38:01 -0000
@@ -461,10 +461,8 @@ function taxonomy_check_vocabulary_hiera
  *   Status constant indicating if term was inserted or updated.
  */
 function taxonomy_term_save($term) {
-  if ($term->name) {
-    // Prevent leading and trailing spaces in term names.
-    $term->name = trim($term->name);
-  }
+  // Prevent leading and trailing spaces in term names.
+  $term->name = trim($term->name);
   if (!isset($term->vocabulary_machine_name)) {
     $vocabulary = taxonomy_vocabulary_load($term->vid);
     $term->vocabulary_machine_name = $vocabulary->machine_name;
@@ -472,22 +470,24 @@ function taxonomy_term_save($term) {
 
   field_attach_presave('taxonomy_term', $term);
 
-  if (!empty($term->tid) && $term->name) {
-    $status = drupal_write_record('taxonomy_term_data', $term, 'tid');
-    field_attach_update('taxonomy_term', $term);
-    module_invoke_all('taxonomy_term_update', $term);
-    entity_invoke('update', 'taxonomy_term', $term);
-  }
-  else {
+  if (empty($term->tid)) {
     $status = drupal_write_record('taxonomy_term_data', $term);
     field_attach_insert('taxonomy_term', $term);
     module_invoke_all('taxonomy_term_insert', $term);
     entity_invoke('insert', 'taxonomy_term', $term);
   }
+  else {
+    $status = drupal_write_record('taxonomy_term_data', $term, 'tid');
+    field_attach_update('taxonomy_term', $term);
+    module_invoke_all('taxonomy_term_update', $term);
+    entity_invoke('update', 'taxonomy_term', $term);
 
-  db_delete('taxonomy_term_hierarchy')
-    ->condition('tid', $term->tid)
-    ->execute();
+    // Remove any existing taxonomy_term_hierachy entries.
+    db_delete('taxonomy_term_hierarchy')
+      ->condition('tid', $term->tid)
+      ->execute();
+    taxonomy_terms_static_reset();
+  }
 
   if (!isset($term->parent) || empty($term->parent)) {
     $term->parent = array(0);
@@ -497,29 +497,23 @@ function taxonomy_term_save($term) {
   }
   $query = db_insert('taxonomy_term_hierarchy')
     ->fields(array('tid', 'parent'));
-  if (is_array($term->parent)) {
-    foreach ($term->parent as $parent) {
-      if (is_array($parent)) {
-        foreach ($parent as $tid) {
-          $query->values(array(
-            'tid' => $term->tid,
-            'parent' => $tid
-          ));
-        }
-      }
-      else {
+  foreach ($term->parent as $parent) {
+    if (is_array($parent)) {
+      foreach ($parent as $tid) {
         $query->values(array(
           'tid' => $term->tid,
-          'parent' => $parent
+          'parent' => $tid
         ));
       }
     }
+    else {
+      $query->values(array(
+        'tid' => $term->tid,
+        'parent' => $parent
+      ));
+    }
   }
   $query->execute();
-
-  cache_clear_all();
-  taxonomy_terms_static_reset();
-
   return $status;
 }
 
