diff --git includes/common.inc includes/common.inc
index e078d68..cae7442 100644
--- includes/common.inc
+++ includes/common.inc
@@ -5528,7 +5528,7 @@ function element_children(&$elements, $sort = FALSE) {
   $children = array();
   $sortable = FALSE;
   foreach ($elements as $key => $value) {
-    if ($key[0] !== '#') {
+    if ($key === '' || $key[0] !== '#') {
       $children[$key] = $value;
       if (is_array($value) && isset($value['#weight'])) {
         $sortable = TRUE;
diff --git modules/simpletest/tests/form.test modules/simpletest/tests/form.test
index 6db4616..763499c 100644
--- modules/simpletest/tests/form.test
+++ modules/simpletest/tests/form.test
@@ -151,6 +151,40 @@ class FormsTestCase extends DrupalWebTestCase {
   }
 
   /**
+   * Test default value handling for radios.
+   *
+   * @see _form_test_radio()
+   */
+  function testRadioProcessing() {
+    // First, try to submit without a radio box changed.
+    $edit = array();
+    $this->drupalPost('form-test/radio', $edit, t('Submit'));
+    // http://drupal.org/node/621366
+    // Enforce comformance to W3C recommendations on radio buttons?
+    // and 
+    // Regression: Required radios throw illegal choice error when none selected
+    // http://drupal.org/node/811542
+    $this->assertRaw(t('An illegal choice has been detected. Please contact the site administrator.'), t('A required radio is actually mandatory'));
+
+    // Now try to submit the form correctly.
+    $values = drupal_json_decode($this->drupalPost(NULL, array('empty_radio_key' => '', 'no_default_radios' => 'two', 'no_default_required_radios' => 'three'), t('Submit')));
+    $expected_values = array(
+      'disabled_radios' => 1,
+      'empty_radio_key' => '',
+      'no_default_radios' => 'two',
+      'no_default_required_radios' => 'three',
+    );
+
+    foreach ($expected_values as $widget => $expected_value) {
+      $this->assertEqual($values[$widget], $expected_value, t('Checkbox %widget returns expected value (expected: %expected, got: %value)', array(
+        '%widget' => var_export($widget, TRUE),
+        '%expected' => var_export($expected_value, TRUE),
+        '%value' => var_export($values[$widget], TRUE),
+      )));
+    }
+  }
+
+  /**
    * Test handling of disabled elements.
    *
    * @see _form_test_disabled_elements()
diff --git modules/simpletest/tests/form_test.module modules/simpletest/tests/form_test.module
index 32f7592..4844263 100644
--- modules/simpletest/tests/form_test.module
+++ modules/simpletest/tests/form_test.module
@@ -93,6 +93,14 @@ function form_test_menu() {
     'type' => MENU_CALLBACK,
   );
 
+  $items['form-test/radio'] = array(
+    'title' => 'Form radio test',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('_form_test_radio'),
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+
   $items['form-test/disabled-elements'] = array(
     'title' => t('Form test'),
     'page callback' => 'drupal_get_form',
@@ -775,6 +783,62 @@ function _form_test_checkbox_submit($form, &$form_state) {
 }
 
 /**
+ * Build a form to test a radio.
+ */
+function _form_test_radio($form, &$form_state) {
+  /**
+   * Radios
+   */
+
+  // A disabled radios should get its default value back.
+  $form['disabled_radios'] = array(
+    '#type' => 'radios',
+    '#disabled' => TRUE,
+    '#default_value' => 1,
+    '#title' => 'disabled_radios',
+    '#options' => array('disabled_radio_one', 'disabled_radio_two', 'disabled_radio_three'),
+  );
+
+  // Radios with empty key are supported.
+  $form['empty_radio_key'] = array(
+    '#type' => 'radios',
+    '#default_value' => '',
+    '#title' => 'empty_radio_key',
+    '#options' => array('' => 'empty_radio_key_one', 'one' => 'empty_radio_key_two', 'two' => 'empty_radio_key_three'),
+  );
+
+  // No default, at present this will return nothing.
+  $form['no_default_radios'] = array(
+    '#type' => 'radios',
+    '#title' => 'no_default_radios',
+    '#options' => array('one' => 'no_default_radio_one', 'two' => 'no_default_radio_two', 'three' => 'no_default_radio_three'),
+  );
+
+  // No default, but required.
+  $form['no_default_required_radios'] = array(
+    '#type' => 'radios',
+    '#title' => 'no_default_radios',
+    '#options' => array('one' => 'no_default_radio_one', 'two' => 'no_default_radio_two', 'three' => 'no_default_radio_three'),
+    '#required' => TRUE,
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Submit')
+  );
+
+  return $form;
+}
+
+/**
+ * Return the form values via JSON.
+ */ 
+function _form_test_radio_submit($form, &$form_state) {
+  drupal_json_output($form_state['values']);
+  exit();
+} 
+
+/**
  * Build a form to test disabled elements.
  */
 function _form_test_disabled_elements($form, &$form_state) {
