diff --git a/admin_menu.inc b/admin_menu.inc
index 5640810..d17e8d4 100644
--- a/admin_menu.inc
+++ b/admin_menu.inc
@@ -372,7 +372,7 @@ function admin_menu_expand_args($arguments) {
  */
 function admin_menu_links_menu($tree) {
   $links = array();
-  foreach ($tree as $key => $data) {
+  foreach ($tree as $data) {
     // Skip invisible items.
     if (!$data['link']['access'] || $data['link']['type'] == MENU_CALLBACK) {
       continue;
@@ -390,14 +390,14 @@ function admin_menu_links_menu($tree) {
     // Remove description to prevent mouseover tooltip clashes.
     unset($data['link']['localized_options']['attributes']['title']);
 
-    $links[$key] = array(
+    $links[$data['link']['href']] = array(
       '#title' => $data['link']['title'],
       '#href' => $data['link']['href'],
       '#options' => $data['link']['localized_options'],
       '#weight' => $data['link']['weight'],
     );
     if ($data['below']) {
-      $links[$key] += admin_menu_links_menu($data['below']);
+      $links[$data['link']['href']] += admin_menu_links_menu($data['below']);
     }
   }
   return $links;
diff --git a/admin_menu.module b/admin_menu.module
index e1137b8..e1b5cd4 100644
--- a/admin_menu.module
+++ b/admin_menu.module
@@ -449,7 +449,7 @@ function admin_menu_output() {
  * Implements hook_admin_menu_output_build().
  */
 function admin_menu_admin_menu_output_build(&$content) {
-  // Add "Add content" link tree on the top level.
+  // Retrieve the "Add content" link tree.
   $link = db_query("SELECT * FROM {menu_links} WHERE router_path = 'node/add' AND module = 'system'")->fetchAssoc();
   $conditions = array();
   for ($i = 1; $i < MENU_MAX_DEPTH; $i++) {
@@ -463,9 +463,17 @@ function admin_menu_admin_menu_output_build(&$content) {
   ));
   $links = admin_menu_links_menu($tree);
   if (!empty($links)) {
-    $key = key($links);
-    $links[$key]['#weight'] = -100;
-    $content['menu'] += $links;
+    // If the user has access to the top-level "Content" category, insert the
+    // "Add content" link tree there.
+    if (isset($content['menu']['admin/content'])) {
+      $content['menu']['admin/content'] += $links;
+    }
+    // Otherwise make insert "Add content" as top-level category.
+    else {
+      $key = key($links);
+      $links[$key]['#weight'] = -100;
+      $content['menu'] += $links;
+    }
   }
 }
 
