Index: wp-admin/includes/plugin.php
===================================================================
--- wp-admin/includes/plugin.php	(revision 16392)
+++ wp-admin/includes/plugin.php	(working copy)
@@ -998,7 +998,7 @@
 
 /**
  * Add sub menu page to the tools main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1017,7 +1017,7 @@
 
 /**
  * Add sub menu page to the options main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1036,7 +1036,7 @@
 
 /**
  * Add sub menu page to the themes main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1055,7 +1055,7 @@
 
 /**
  * Add sub menu page to the plugins main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1074,7 +1074,7 @@
 
 /**
  * Add sub menu page to the Users/Profile main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1096,7 +1096,7 @@
 }
 /**
  * Add sub menu page to the Dashboard main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1115,7 +1115,7 @@
 
 /**
  * Add sub menu page to the posts main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1134,7 +1134,7 @@
 
 /**
  * Add sub menu page to the media main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1153,7 +1153,7 @@
 
 /**
  * Add sub menu page to the links main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1172,7 +1172,7 @@
 
 /**
  * Add sub menu page to the pages main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1191,7 +1191,7 @@
 
 /**
  * Add sub menu page to the comments main menu.
-*
+ *
  * This function takes a capability which will be used to determine whether
  * or not a page is included in the menu.
  *
@@ -1270,10 +1270,11 @@
 	global $_parent_pages;
 
 	if ( isset( $_parent_pages[$menu_slug] ) ) {
-		if ( $_parent_pages[$menu_slug] ) {
-			$url = admin_url( add_query_arg( 'page', $menu_slug, $_parent_pages[$menu_slug] ) );
+		$parent_slug = $_parent_pages[$menu_slug];
+		if ( $parent_slug && ! isset( $_parent_pages[$parent_slug] ) ) {
+			$url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );
 		} else {
-			$url = admin_url('admin.php?page=' . $menu_slug);
+			$url = admin_url( 'admin.php?page=' . $menu_slug );
 		}
 	} else {
 		$url = '';
@@ -1684,4 +1685,4 @@
 	wp_nonce_field("$option_group-options");
 }
 
-?>
\ No newline at end of file
+?>
