diff --git a/includes/form.inc b/includes/form.inc
index 7ddd6125d51e970d2b499b19f92378793fc7f5fc..daf164368310645749484ea622976660247b0f1e 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2200,7 +2200,7 @@ function form_process_container($element, &$form_state) {
  * @param $element
  *   An associative array containing the properties and children of the
  *   group.
- *   Properties used: #children.
+ *   Properties used: #id, #attributes, #children.
  * @return
  *   A themed HTML string representing the form element.
  *
@@ -2208,7 +2208,12 @@ function form_process_container($element, &$form_state) {
  */
 function theme_container($variables) {
   $element = $variables['element'];
-  return '<div class="form-wrapper" id="' . $element['#id'] . '">' . $element['#children'] . '</div>';
+  if (!isset($element['#attributes']['id'])) {
+    $element['#attributes']['id'] = drupal_html_id($element['#id']);
+  }
+  // Force the 'form-wrapper' class.
+  $element['#attributes']['class'][] = 'form-wrapper';
+  return '<div' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</div>';
 }
 
 /**
diff --git a/modules/block/block.module b/modules/block/block.module
index 306870b99de6714b0442aa9802458aa0a8127e25..374ffdd84487f4156750af5e5f11cfa506f5353f 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -574,18 +574,19 @@ function block_theme_initialize($theme) {
  *   array key instead of <i>module</i>_<i>delta</i>.
  */
 function block_list($region) {
-  $blocks = &drupal_static(__FUNCTION__, array());
+  $blocks = &drupal_static(__FUNCTION__);
 
-  if (empty($blocks)) {
+  if (!isset($blocks)) {
     $blocks = _block_load_blocks();
   }
 
-  // Create an empty array if there were no entries.
+  // Create an empty array if there are no entries.
   if (!isset($blocks[$region])) {
     $blocks[$region] = array();
   }
-
-  $blocks[$region] = _block_render_blocks($blocks[$region]);
+  else {
+    $blocks[$region] = _block_render_blocks($blocks[$region]);
+  }
 
   return $blocks[$region];
 }
diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module
index c04c815bc44f456d4dbf9c94b7f8d695acb80cb9..e7091fe4dc96363213763d94464c3c37f0042988 100644
--- a/modules/dashboard/dashboard.module
+++ b/modules/dashboard/dashboard.module
@@ -208,8 +208,12 @@ function dashboard_admin($launch_customize = FALSE) {
  * Returns TRUE if the user is currently viewing the dashboard.
  */
 function dashboard_is_visible() {
-  $menu_item = menu_get_item();
-  return isset($menu_item['page_callback']) && $menu_item['page_callback'] == 'dashboard_admin';
+  static $is_visible;
+  if (!isset($is_visible)) {
+    $menu_item = menu_get_item();
+    $is_visible = isset($menu_item['page_callback']) && $menu_item['page_callback'] == 'dashboard_admin';
+  }
+  return $is_visible;
 }
 
 /**
@@ -225,7 +229,11 @@ function dashboard_region_descriptions() {
  * Return an array of dashboard region names.
  */
 function dashboard_regions() {
-  return array_keys(dashboard_region_descriptions());
+  static $regions;
+  if (!isset($regions)) {
+    $regions = array_keys(dashboard_region_descriptions());
+  }
+  return $regions;
 }
 
 /**
@@ -233,7 +241,7 @@ function dashboard_regions() {
  */
 function dashboard_dashboard_regions() {
   return array(
-    'dashboard_main' =>  'Dashboard main',
+    'dashboard_main' => 'Dashboard main',
     'dashboard_sidebar' => 'Dashboard sidebar',
   );
 }