Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.428
diff -u -p -r1.428 menu.inc
--- includes/menu.inc	8 Dec 2010 06:48:39 -0000	1.428
+++ includes/menu.inc	14 Dec 2010 13:30:28 -0000
@@ -2544,10 +2544,7 @@ function menu_reset_static_cache() {
  *
  * This function will clear and populate the {menu_router} table, add entries
  * to {menu_links} for new router items, then remove stale items from
- * {menu_links}. If called from update.php or install.php, it will also
- * schedule a call to itself on the first real page load from
- * menu_execute_active_handler(), because the maintenance page environment
- * is different and leaves stale data in the menu tables.
+ * {menu_links}.
  *
  * @return
  *   TRUE if the menu was rebuilt, FALSE if another thread was rebuilding
@@ -2571,13 +2568,8 @@ function menu_rebuild() {
     // Clear the menu, page and block caches.
     menu_cache_clear_all();
     _menu_clear_page_cache();
-
-    if (defined('MAINTENANCE_MODE')) {
-      variable_set('menu_rebuild_needed', TRUE);
-    }
-    else {
-      variable_del('menu_rebuild_needed');
-    }
+    // Indicate that the menu has been successfully rebuilt.
+    variable_del('menu_rebuild_needed');
   }
   catch (Exception $e) {
     $transaction->rollback();
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.435
diff -u -p -r1.435 block.module
--- modules/block/block.module	23 Nov 2010 16:12:15 -0000	1.435
+++ modules/block/block.module	14 Dec 2010 13:30:28 -0000
@@ -149,7 +149,7 @@ function block_menu() {
       'type' => $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
       'weight' => $key == $default_theme ? -10 : 0,
       'access callback' => '_block_themes_access',
-      'access arguments' => array($theme),
+      'access arguments' => array($key),
       'file' => 'block.admin.inc',
     );
     if ($key != $default_theme) {
@@ -168,7 +168,7 @@ function block_menu() {
       'page arguments' => array($key),
       'type' => MENU_CALLBACK,
       'access callback' => '_block_themes_access',
-      'access arguments' => array($theme),
+      'access arguments' => array($key),
       'theme callback' => '_block_custom_theme',
       'theme arguments' => array($key),
       'file' => 'block.admin.inc',
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.998
diff -u -p -r1.998 system.module
--- modules/system/system.module	9 Dec 2010 01:51:16 -0000	1.998
+++ modules/system/system.module	14 Dec 2010 13:30:28 -0000
@@ -636,13 +636,13 @@ function system_menu() {
     'weight' => -1,
   );
 
-  foreach (list_themes() as $theme) {
+  foreach (list_themes() as $key => $theme) {
     $items['admin/appearance/settings/' . $theme->name] = array(
       'title' => $theme->info['name'],
       'page arguments' => array('system_theme_settings', $theme->name),
       'type' => MENU_LOCAL_TASK,
       'access callback' => '_system_themes_access',
-      'access arguments' => array($theme),
+      'access arguments' => array($key),
       'file' => 'system.admin.inc',
     );
   }
