Index: includes/ajax.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/ajax.inc,v
retrieving revision 1.12
diff -u -p -r1.12 ajax.inc
--- includes/ajax.inc	2 Oct 2009 14:55:40 -0000	1.12
+++ includes/ajax.inc	4 Oct 2009 15:02:25 -0000
@@ -132,7 +132,7 @@ function ajax_render($commands = array()
   // them the first command.
   $scripts = drupal_add_js(NULL, NULL);
   if (!empty($scripts['settings'])) {
-    array_unshift($commands, ajax_command_settings($scripts['settings']['data']));
+    array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $scripts['settings']['data'])));
   }
 
   // Allow modules to alter any AJAX response.
@@ -146,7 +146,7 @@ function ajax_render($commands = array()
     // http://malsup.com/jquery/form/#code-samples
     print '<textarea>' . drupal_json_encode($commands) . '</textarea>';
   }
-  else if ($header) {
+  elseif ($header) {
     drupal_json_output($commands);
   }
   else {
@@ -733,7 +733,7 @@ function ajax_command_css($selector, $ar
 function ajax_command_settings($argument) {
   return array(
     'command' => 'settings',
-    'argument' => $argument,
+    'settings' => $argument,
   );
 }
 
