diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index d713f92..b5b8983 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2789,15 +2789,15 @@ function template_preprocess_maintenance_page(&$variables) {
   foreach (array_keys($regions) as $region) {
     // Assign region to a region variable.
     $region_content = drupal_get_region_content($region);
-    isset($variables[$region]) ? $variables[$region] .= $region_content : $variables[$region] = $region_content;
+    isset($variables['regions'][$region]) ? $variables['regions'][$region] .= $region_content : $variables['regions'][$region] = $region_content;
   }
 
   // Setup layout variable.
   $variables['layout'] = 'none';
-  if (!empty($variables['sidebar_first'])) {
+  if (!empty($variables['regions']['sidebar_first'])) {
     $variables['layout'] = 'first';
   }
-  if (!empty($variables['sidebar_second'])) {
+  if (!empty($variables['regions']['sidebar_second'])) {
     $variables['layout'] = ($variables['layout'] == 'first') ? 'both' : 'second';
   }
 
