diff --git a/includes/menu.inc b/includes/menu.inc
index 007e4a2b9e8530e2ae714bece64e1bacd81784b2..f510146c0234e28055d3d626c141f365469d5e25 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -2566,10 +2566,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
@@ -2593,13 +2590,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();
diff --git a/modules/block/block.module b/modules/block/block.module
index 7790600f16fad0a86abb211a88bd828fe9c2b39f..c5e229bb8ca118363c3e373b1a68e244bd2bdc15 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -148,7 +148,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) {
@@ -167,7 +167,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',
diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module
index 59b2beb6644b43b97ce43c74e8537a2953f645ba..28ac0e1d351d3a0c6c4258cc879e89b75837c974 100644
--- a/modules/field_ui/field_ui.module
+++ b/modules/field_ui/field_ui.module
@@ -60,12 +60,6 @@ function field_ui_menu() {
     'file' => 'field_ui.admin.inc',
   );
 
-  // Ensure the following is not executed until field_bundles is working and
-  // tables are updated. Needed to avoid errors on initial installation.
-  if (defined('MAINTENANCE_MODE')) {
-    return $items;
-  }
-
   // Create tabs for all possible bundles.
   foreach (entity_get_info() as $entity_type => $entity_info) {
     if ($entity_info['fieldable']) {
diff --git a/modules/system/system.module b/modules/system/system.module
index 5af9ad4ee1be655849211fe24dd29630942b089f..21b23f4c223ecf3e7fd2a53a2dd348b67110a320 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -635,13 +635,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',
     );
   }