--- includes\form.inc	2008-12-03 17:32:22.000000000 +0100
+++ includes\form.new.inc	2008-12-08 13:58:35.865959000 +0100
@@ -1429,6 +1429,9 @@
   $value_is_array = is_array($element['#value']);
   $options = '';
   foreach ($choices as $key => $choice) {
+    if (is_null($choice['#value'])) {
+      $choice = array('#value' => $choice);
+    }
     if (is_array($choice)) {
       $options .= '<optgroup label="' . $key . '">';
       $options .= form_select_options($element, $choice);
@@ -1445,7 +1448,8 @@
       else {
         $selected = '';
       }
-      $options .= '<option value="' . check_plain($key) . '"' . $selected . '>' . check_plain($choice) . '</option>';
+      $attributes = (isset($choice['#attributes']) ? drupal_attributes($choice['#attributes']) : '');
+      $options .= '<option value="'. check_plain($key) .'"'. $selected . $attributes .'>'. check_plain($choice['#value']) .'</option>';
     }
   }
   return $options;
