diff --git a/taxonomy_manager.module b/taxonomy_manager.module
index 99acdb4..353b648 100755
--- a/taxonomy_manager.module
+++ b/taxonomy_manager.module
@@ -994,13 +994,19 @@ function taxonomy_manager_tree_validate($form, &$form_state) {
   //this can be useful for more complex processing, where the parent of the selecte term in the tree view is need (releveant if multi parent)
   //used in double tree
   $direct_parents = array();
-  
   if ($form['#multiple']) {
     $selected = _taxonomy_manager_tree_get_selected_terms($form['#value'], $direct_parents);
   }
   else if (is_numeric($form['#value'])) {
     $selected[$form['#value']] = $form['#value'];
   }
+  else {
+    // There should only be one selected term here. Make sure this is the case.
+    $selected = _taxonomy_manager_tree_get_selected_terms($form['#value'], $direct_parents);
+    if (count($selected) > 1) {
+      $selected = array(key($selected) => key($selected));
+    }
+  }
 
   $vid = $form['#vid'];
   foreach ($selected as $tid) {
@@ -1176,17 +1182,16 @@ function theme_taxonomy_manager_tree_checkbox($variables) {
  */
 function theme_taxonomy_manager_tree_radio($variables) {
   $element = $variables['element'];
+  
+  $element['#attributes']['type'] = 'radio';
+  element_set_attributes($element, array('id', 'name', '#return_value' => 'value'));
+  if (isset($element['#return_value']) && $element['#value'] !== FALSE && $element['#value'] == 
+    $element['#return_value']) {
+    $element['#attributes']['checked'] = 'checked';
+  }
   _form_set_class($element, array('form-radio'));
-  $output = '<input ';
-  $output .= 'type="radio" ';
-  $output .= 'name="'. $element['#parents'][0] .'" ';
-  $output .= 'id="'. $element['#id'] .'" ' ;  
-  $output .= 'value="'. $element['#return_value'] .'" ';
-  $checkbox = $element['#value'] ? ' checked="checked" ' : ' ';
-
   
-  $output .= $element['#value'] ? ' checked="checked" ' : ' ';
-  $output .= drupal_attributes($element['#attributes']) .' />';
+  $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
   
   $title = $element['#title'];
   if (isset($element['#link'])) {
@@ -1199,8 +1204,8 @@ function theme_taxonomy_manager_tree_radio($variables) {
   if (!is_null($title)) {
     $element['#children'] = '<label class="option">'. $output .' '. $title .'</label>';
   }
-
+ 
   $element['#title_display'] = 'none';
+  
   return theme('form_element', array('element' => $element));
-}
-
+}
\ No newline at end of file
