diff --git a/includes/features.menu.inc b/includes/features.menu.inc
index a11350f..489b443 100644
--- a/includes/features.menu.inc
+++ b/includes/features.menu.inc
@@ -295,16 +295,13 @@ function menu_links_features_rebuild_ordered($menu_links, $reset = FALSE) {
         foreach ($unordered as $key => $link) {
           $identifier = menu_links_features_identifier($link);
           $parent = isset($link['parent_identifier']) ? $link['parent_identifier'] : '';
-          if (empty($parent)) {
-            $ordered[$identifier] = 0;
-            $all_links[$identifier] = $link;
-            unset($unordered[$key]);
-          }
-          elseif (isset($ordered[$parent])) {
-            $ordered[$identifier] = $ordered[$parent] + 1;
-            $all_links[$identifier] = $link;
-            unset($unordered[$key]);
+          $weight = 0;
+          if (isset($ordered[$parent])) {
+            $weight = $ordered[$parent] + 1;
           }
+          $ordered[$identifier] = $weight;
+          $all_links[$identifier] = $link;
+          unset($unordered[$key]);
         }
       } while (count($unordered) < $current);
     }
