bringing form helper in sync
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 60d2631..5feb3ce 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -66,7 +66,6 @@
 	}
 }
 
-
 // ------------------------------------------------------------------------
 
 /**
@@ -266,7 +265,7 @@
  * @param	string
  * @return	type
  */
-if (! function_exists('form_multiselect'))
+if ( ! function_exists('form_multiselect'))
 {
 	function form_multiselect($name = '', $options = array(), $selected = array(), $extra = '')
 	{
@@ -320,7 +319,7 @@
 		{
 			$key = (string) $key;
 
-			if (is_array($val))
+			if (is_array($val) && ! empty($val))
 			{
 				$form .= '<optgroup label="'.$key.'">'."\n";
 
@@ -638,7 +637,7 @@
 
 		if ($field_name != '')
 		{
-			$prepped_fields[$field_name] = $str;
+			$prepped_fields[$field_name] = $field_name;
 		}
 		
 		return $str;