diff --git a/core/includes/form.inc b/core/includes/form.inc
index 87ae891..85c7900 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -1725,7 +1725,6 @@ function form_builder($form_id, &$element, &$form_state) {
   // Assign basic defaults common for all form elements.
   $element += array(
     '#required' => FALSE,
-    '#attributes' => array(),
     '#title_display' => 'before',
   );
 
@@ -2955,7 +2954,7 @@ function form_process_radios($element) {
         // theme function.
         '#return_value' => $key,
         '#default_value' => isset($element['#default_value']) ? $element['#default_value'] : NULL,
-        '#attributes' => $element['#attributes'],
+        '#attributes' => isset($element['#attributes']) ? $element['#attributes'] : array(),
         '#parents' => $element['#parents'],
         '#id' => drupal_html_id('edit-' . implode('-', $parents_for_id)),
         '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL,
@@ -3090,7 +3089,7 @@ function form_process_checkboxes($element) {
         '#title' => $choice,
         '#return_value' => $key,
         '#default_value' => isset($value[$key]) ? $key : NULL,
-        '#attributes' => $element['#attributes'],
+        '#attributes' => isset($element['#attributes']) ? $element['#attributes'] : array(),
         '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL,
         '#weight' => $weight,
       );
@@ -3230,7 +3229,12 @@ function theme_tableselect($variables) {
       array_unshift($header, '');
     }
   }
-  return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty'], 'attributes' => $element['#attributes']));
+  return theme('table', array(
+    'header' => $header,
+    'rows' => $rows,
+    'empty' => $element['#empty'],
+    'attributes' => isset($element['#attributes']) ? $element['#attributes'] : array(),
+  ));
 }
 
 /**
@@ -3278,7 +3282,7 @@ function form_process_tableselect($element) {
             '#title_display' => 'invisible',
             '#return_value' => $key,
             '#default_value' => isset($value[$key]) ? $key : NULL,
-            '#attributes' => $element['#attributes'],
+            '#attributes' => isset($element['#attributes']) ? $element['#attributes'] : array(),
           );
         }
         else {
@@ -3290,7 +3294,7 @@ function form_process_tableselect($element) {
             '#title' => '',
             '#return_value' => $key,
             '#default_value' => ($element['#default_value'] == $key) ? $key : NULL,
-            '#attributes' => $element['#attributes'],
+            '#attributes' => isset($element['#attributes']) ? $element['#attributes'] : array(),
             '#parents' => $element['#parents'],
             '#id' => drupal_html_id('edit-' . implode('-', $parents_for_id)),
             '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL,
