diff --git a/misc/drupal.js b/misc/drupal.js
index a22eb387ba12071f400a6f18729502280bd4fb76..933811201bb7f52856c54f386d8f00216bf5a2a0 100644
--- a/misc/drupal.js
+++ b/misc/drupal.js
@@ -12,8 +12,8 @@ Drupal.jsEnabled = document.getElementsByTagName && document.createElement && do
  */
 Drupal.extend = function(obj) {
   for (var i in obj) {
-    if (this[i]) {
-      Drupal.extend.apply(this[i], [obj[i]]);
+    if (this[i] && (typeof(this[i]) == 'function' || typeof(this[i]) == 'object')) {
+   	  Drupal.extend.apply(this[i], [obj[i]]);
     }
     else {
       this[i] = obj[i];