diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 47c99d9..e2c06ec 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1157,6 +1157,15 @@ function theme($hook, $variables = array()) {
       template_preprocess($default_template_variables, $hook);
       $variables += $default_template_variables;
     }
+    if (isset($variables['attributes']) && $variables['attributes'] && !($variables['attributes'] instanceof Attribute)) {
+      $variables['attributes'] = new Attribute($variables['attributes']);
+    }
+    if (isset($variables['title_attributes']) && $variables['title_attributes'] && !($variables['title_attributes'] instanceof Attribute)) {
+      $variables['title_attributes'] = new Attribute($variables['title_attributes']);
+    }
+    if (isset($variables['content_attributes']) && $variables['content_attributes'] && !($variables['content_attributes'] instanceof Attribute)) {
+      $variables['content_attributes'] = new Attribute($variables['content_attributes']);
+    }
 
     // Render the output using the template file.
     $template_file = $info['template'] . $extension;
@@ -2637,13 +2646,10 @@ function template_preprocess(&$variables, $hook) {
   if (!isset($default_variables)) {
     $default_variables = _template_preprocess_default_variables();
   }
-  if (!isset($default_attributes)) {
-    $default_attributes = new Attribute(array('class' => array()));
-  }
   $variables += $default_variables + array(
-    'attributes' => clone $default_attributes,
-    'title_attributes' => clone $default_attributes,
-    'content_attributes' => clone $default_attributes,
+    'attributes' => array(),
+    'title_attributes' => array(),
+    'content_attributes' => array(),
   );
 
   // Initialize html class attribute for the current hook.
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index 8e2a378..2b26fbb 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -481,7 +481,7 @@ function views_preprocess_html(&$variables) {
   // the "contextual-region" class from the <body> tag here and add
   // JavaScript that will insert it back in the correct place.
   if (!empty($variables['page']['#views_contextual_links_info'])) {
-    $key = array_search('contextual-region', $variables['attributes']['class']->value());
+    $key = array_search('contextual-region', $variables['attributes']['class']);
     if ($key !== FALSE) {
       unset($variables['attributes']['class'][$key]);
       // Add the JavaScript, with a group and weight such that it will run
