diff --git a/includes/plugins.inc b/includes/plugins.inc
index 9077d38..8e5253e 100644
--- a/includes/plugins.inc
+++ b/includes/plugins.inc
@@ -175,12 +175,12 @@ class panels_cache_object {
 
     // If there are any differences between the old and the new javascript then
     // store them to be added later.
-    if ($diff = array_diff_assoc($js, $start)) {
+    if ($diff = array_diff_key($js, $start)) {
       $this->js = $diff;
     }
 
     // Special case the settings key and get the difference of the data.
-    if ($settings_diff = array_diff_assoc($js['settings']['data'], $start['settings']['data'])) {
+    if ($settings_diff = array_diff_key($js['settings']['data'], $start['settings']['data'])) {
       $this->js['settings'] = $settings_diff;
     }
 
