diff --git a/js/ajax_view.js b/js/ajax_view.js
index e3bc821..0872167 100644
--- a/js/ajax_view.js
+++ b/js/ajax_view.js
@@ -56,6 +56,9 @@ Drupal.views.ajaxView = function(settings) {
 
   this.settings = settings;
 
+  settings.view_name = (typeof settings.view_name != 'undefined') ? settings.view_name : false;
+  settings.view_display_id = (typeof settings.view_display_id != 'undefined') ? settings.view_display_id : false;
+
   // Add the ajax to exposed forms.
   this.$exposed_form = $('form#views-exposed-form-'+ settings.view_name.replace(/_/g, '-') + '-' + settings.view_display_id.replace(/_/g, '-'));
   this.$exposed_form.once(jQuery.proxy(this.attachExposedFormAjax, this));
diff --git a/plugins/views_plugin_cache.inc b/plugins/views_plugin_cache.inc
index 4d21701..92f4c61 100644
--- a/plugins/views_plugin_cache.inc
+++ b/plugins/views_plugin_cache.inc
@@ -203,24 +203,51 @@ class views_plugin_cache extends views_plugin {
     // Slightly less simple for CSS:
     $css = drupal_add_css();
     $css_start = isset($this->storage['css']) ? $this->storage['css'] : array();
-    $this->storage['css'] = array_diff_assoc($css, $css_start);
+    $this->storage['css'] = $this->array_diff_assoc_recursive($css, $css_start);
 
     // Get javascript after/before views renders.
     $js = drupal_add_js();
     $js_start = isset($this->storage['js']) ? $this->storage['js'] : array();
     // If there are any differences between the old and the new javascript then
     // store them to be added later.
-    $this->storage['js'] = array_diff_assoc($js, $js_start);
+     $this->storage['js'] = $this->array_diff_assoc_recursive($js, $js_start);
 
     // Special case the settings key and get the difference of the data.
     $settings = isset($js['settings']['data']) ? $js['settings']['data'] : array();
     $settings_start = isset($js_start['settings']['data']) ? $js_start['settings']['data'] : array();
-    $this->storage['js']['settings'] = array_diff_assoc($settings, $settings_start);
+    
+    $settings = is_array($settings) ? $settings : array();
+    $settings_start = is_array($settings_start) ? $settings_start : array();
+    
+    $this->storage['js'] = is_array($this->storage['js']) ? $this->storage['js'] : array();
+    
+    $this->storage['js']['settings'] = $this->array_diff_assoc_recursive($settings, $settings_start);
 
     // Get difference of HTTP headers.
     $this->storage['headers'] = array_diff_assoc(drupal_get_http_header(), $this->storage['headers']);
   }
 
+  /* complementary function due PHP 5.4 issue 1511396 */
+  function array_diff_assoc_recursive($array1, $array2) {
+    foreach ($array1 as $key => $value) {
+      if (is_array($value)) {
+        if (!isset($array2[$key])) {
+          $difference[$key] = $value;
+        } elseif (!is_array($array2[$key])) {
+          $difference[$key] = $value;
+        } else {
+          $new_diff = $this->array_diff_assoc_recursive($value, $array2[$key]);
+          if ($new_diff != FALSE) {
+            $difference[$key] = $new_diff;
+          }
+        }
+      } elseif (!isset($array2[$key]) || $array2[$key] != $value) {
+        $difference[$key] = $value;
+      }
+    }
+    return !isset($difference) ? 0 : $difference;
+  }
+
   /**
    * Restore out of band data saved to cache. Copied from Panels.
    */
@@ -235,10 +262,10 @@ class views_plugin_cache extends views_plugin {
     }
     if (!empty($this->storage['js'])) {
       foreach ($this->storage['js'] as $key => $args) {
-        if ($key !== 'settings') {
+        if ($key !== 'settings' && isset($args['data'])) {
           drupal_add_js($args['data'], $args);
         }
-        else {
+        elseif (is_array($args)) {
           foreach ($args as $setting) {
             drupal_add_js($setting, 'setting');
           }
diff --git a/theme/theme.inc b/theme/theme.inc
index e7f7a15..b32429f 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -113,7 +113,7 @@ function template_preprocess_views_view(&$vars) {
     // we set up a hash with the current time, $dom_id, to issue a "unique" identifier for
     // each view. This identifier is written to both Drupal.settings and the DIV
     // wrapper.
-    $vars['dom_id'] = $view->dom_id;
+    $vars['dom_id'] = isset($view->dom_id) ? $view->dom_id : FALSE;
     $vars['classes_array'][] = 'view-dom-id-' . $vars['dom_id'];
   }
