diff --git a/includes/form.inc b/includes/form.inc
index c0163ca..a85d682 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1676,7 +1676,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',
   );
 
@@ -2896,7 +2895,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,
@@ -3031,7 +3030,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,
       );
