--- ./includes/theme.inc.orig	2009-08-15 12:52:07.000000000 +0200
+++ ./includes/theme.inc	2009-08-19 00:25:57.000000000 +0200
@@ -21,8 +21,6 @@
  *   A themed HTML string representing the form element.
  */
 function theme_hierarchical_select($element) {
-  $output = '';
-
   // Update $element['#attributes']['class'].
   $hsid = $element['hsid']['#value'];
   $level_labels_style = variable_get('hierarchical_select_level_labels_style', 'none');
@@ -34,14 +32,14 @@
   $element['#attributes']['id'] = "hierarchical-select-$hsid-wrapper";
   $element['#id'] = "hierarchical-select-$hsid-wrapper"; // This ensures the label's for attribute is correct.
 
-  $output .= theme(
+  $output = theme(
     'form_element',
     array(
       '#title' => $element['#title'],
       '#description' => $element['#description'],
       '#id' => $element['#id'],
       '#required' => $element['#required'],
-      '#error' => $element['#error'],
+      '#error' => isset($element['#error']) ? $element['#error'] : '',
     ),
     '<div '. drupal_attributes($element['#attributes']) .'>'. $element['#children'] .'</div>'
   );
--- ./modules/hs_menu.module.orig	2009-08-05 10:17:44.000000000 +0200
+++ ./modules/hs_menu.module	2009-08-19 00:26:00.000000000 +0200
@@ -29,7 +29,7 @@
  * Implementation of hook_form_alter().
  */
 function hs_menu_form_alter(&$form, &$form_state, $form_id) {
-  if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id && isset($form['menu']['parent']) && $form['menu']['#access']) {
+  if (isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id && isset($form['menu']['parent']) && $form['menu']['#access']) {
     unset($form['menu']['parent']['#options']);
     $form['menu']['parent']['#type'] = 'hierarchical_select';
     _hs_menu_apply_config($form['menu']['parent'], NULL);
--- ./hierarchical_select.module.orig	2009-08-15 15:15:47.000000000 +0200
+++ ./hierarchical_select.module	2009-08-19 00:26:09.000000000 +0200
@@ -100,6 +100,7 @@
       'save_lineage'    => 0,
       'enforce_deepest' => 0,
       'entity_count'    => 0,
+      'require_entity'  => 0,
       'resizable'       => 1,
       'level_labels' => array(
         'status' => 0,
@@ -535,7 +536,7 @@
 
   // The selects in the hierarchical select should inherit the #size property.
   foreach (element_children($element['hierarchical_select']['selects']) as $depth) {
-    $element['hierarchical_select']['selects'][$depth]['#size'] = $element['#size'];
+    $element['hierarchical_select']['selects'][$depth]['#size'] = isset($element['#size']) ? $element['#size'] : 0;
   }
 
   // Check if a new item is being created.
@@ -654,7 +655,7 @@
   // is set to 'label_0' after an "Add" operation. When $element['#post'] is
   // NOT unset, the corresponding value in $element['#post'] will be used
   // instead of the default value that was set. This is undesired behavior.
-  unset($element['#post']);
+  $element['#post'] = array();
 
   // Finally, calculate the return value of this hierarchical_select form
   // element. This will be set in _hierarchical_select_validate(). (If we'd
@@ -682,7 +683,7 @@
 
   // If the form item is marked as disabled, disable all child form items as
   // well.
-  if ($element['#disabled']) {
+  if (!empty($element['#disabled'])) {
     _hierarchical_select_mark_as_disabled($element);
   }
 
@@ -746,7 +747,7 @@
   // the associated values from the cache. The _hierarchical_select_submit()
   // must be the first submit callback to ensure that it's executed: if a
   // submit callback before it performs a drupal_goto(), it won't be called!
-  $form_state['hs_form_build_id'] = $_POST['hs_form_build_id'];
+  $form_state['hs_form_build_id'] = $hs_form_build_id;
   $form['#submit'] = (is_array($form['#submit'])) ? $form['#submit'] : array();
   $form['#submit'] = array_merge(array('_hierarchical_select_submit'), $form['#submit']);
 
@@ -795,7 +796,7 @@
   // If the form item is disabled, set the default value as the return value,
   // because otherwise nothing would be returned (disabled form items are not
   // submitted, as described in the HTML standard).
-  if ($element['#disabled']) {
+  if (!empty($element['#disabled'])) {
     $element['#return_value'] = $element['#default_value'];
   }
 
@@ -847,7 +848,7 @@
   $hs_selection = array();
   $config = _hierarchical_select_inherit_default_config($element['#config']);
 
-  if (count($element['#value']['hierarchical_select']['selects'])) {
+  if (!empty($element['#value']['hierarchical_select']['selects'])) {
     if ($config['save_lineage']) {
       foreach ($element['#value']['hierarchical_select']['selects'] as $key => $value) {
         $hs_selection[] = $value;
@@ -949,14 +950,13 @@
 
   $config = _hierarchical_select_inherit_default_config($element['#config']);
   $dropbox = (bool) $config['dropbox']['status'];
-  $op = $element['#post']['op'];
 
   // When:
   // - no data was POSTed,
   // - or #value is set directly and not by a Hierarchical Select POST (and
   //   therefor set either manually or by another module),
   // then use the value of #default_value, or when available, of #value.
-  if (empty($element['#post']) || !isset($element['#value']['hierarchical_select'])) {
+  if (!isset($element['#post']['op']) || !isset($element['#value']['hierarchical_select'])) {
     $value = (isset($element['#value'])) ? $element['#value'] : $element['#default_value'];
     $value = (is_array($value)) ? $value : array($value);
     if ($dropbox) {
@@ -967,6 +967,7 @@
     }
   }
   else {
+    $op = $element['#post']['op'];
     if ($dropbox && $op == t('Add')) {
       $hs_selection = _hierarchical_select_process_get_hs_selection($element);
       $db_selection = _hierarchical_select_process_get_db_selection($element);
