diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index fb27d6c..4c063c6 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -460,7 +460,7 @@ function taxonomy_overview_terms_submit($form, &$form_state) {
 
   // Build a list of all terms that need to be updated on previous pages.
   $weight = 0;
-  $term = (array)array_shift($tree);
+  $term = (array)$tree[0];
   while ($term['tid'] != $form['#first_tid']) {
     if ($term['parents'][0] == 0 && $term['weight'] != $weight) {
       $term['parent'] = $term['parents'][0];
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index fb40e96..35360dd 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -833,9 +833,9 @@ function taxonomy_get_children($tid, $vid = 0, $key = 'tid') {
  *   The number of levels of the tree to return. Leave NULL to return all levels.
  *
  * @return
- *   An array of all term objects in the tree, indexed by taxonomy id (tid).
- *   Each term object is extended to have "depth" and "parents" attributes in
- *   addition to its normal ones. Results are statically cached.
+ *   An array of all term objects in the tree. Each term object is extended
+ *   to have "depth" and "parents" attributes in addition to its normal ones.
+ *   Results are statically cached.
  */
 function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
   static $children, $parents, $terms;
@@ -865,10 +865,10 @@ function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
         // The "parent" attribute is not useful, as it would show one parent only.
         unset($term->parent);
         $term->parents = $parents[$vid][$child];
-        $tree[$term->tid] = $term;
+        $tree[] = $term;
 
         if (!empty($children[$vid][$child])) {
-          $tree += taxonomy_get_tree($vid, $child, $depth, $max_depth);
+          $tree = array_merge($tree, taxonomy_get_tree($vid, $child, $depth, $max_depth));
         }
       }
     }
