diff --git quicktabs.module quicktabs.module
index 83125ff..2096622 100755
--- quicktabs.module
+++ quicktabs.module
@@ -183,7 +183,7 @@ function quicktabs_render($quicktabs) {
     foreach ($quicktabs['tabs'] as $key => $tab) {
       $contents = quicktabs_render_tabpage($tab, TRUE);
       if (empty($contents)) {
-        unset($quicktabs['tabs'][$key]);
+        $quicktabs['tabs'][$key] = NULL;
       }
     }
     $quicktabs['tabs'] = array_merge($quicktabs['tabs']);
@@ -353,19 +353,21 @@ function theme_quicktabs_tabs($quicktabs, $active_tab = 'none') {
   $index = 1;
   $output .= '<ul class="quicktabs_tabs quicktabs-style-'. drupal_strtolower($quicktabs['style']) .'">';
   foreach ($quicktabs['tabs'] as $tabkey => $tab) {
-    $class = 'qtab-'. $tabkey;
-    // Add first, last and active classes to the list of tabs to help out themers.
-    $class .= ($tabkey == $active_tab ? ' active' : '');
-    $class .= ($index == 1 ? ' first' : '');
-    $class .= ($index == $tabs_count ? ' last': '');
-    $attributes_li = drupal_attributes(array('class' => $class));
-    $options = _quicktabs_construct_link_options($quicktabs, $tabkey);
-    // Support for translatable tab titles with i18nstrings.module.
-    if (module_exists('i18nstrings')) {
-      $tab['title'] = tt("quicktabs:tab:$quicktabs[machine_name]--$tabkey:title", $tab['title']);
+    if(!empty($tab)) {
+      $class = 'qtab-'. $tabkey;
+      // Add first, last and active classes to the list of tabs to help out themers.
+      $class .= ($tabkey == $active_tab ? ' active' : '');
+      $class .= ($index == 1 ? ' first' : '');
+      $class .= ($index == $tabs_count ? ' last': '');
+      $attributes_li = drupal_attributes(array('class' => $class));
+      $options = _quicktabs_construct_link_options($quicktabs, $tabkey);
+      // Support for translatable tab titles with i18nstrings.module.
+      if (module_exists('i18nstrings')) {
+        $tab['title'] = tt("quicktabs:tab:$quicktabs[machine_name]--$tabkey:title", $tab['title']);
+      }
+      $output .= '<li'. $attributes_li .'>'. l($tab['title'], $_GET['q'], $options) .'</li>';
+      $index++;
     }
-    $output .= '<li'. $attributes_li .'>'. l($tab['title'], $_GET['q'], $options) .'</li>';
-    $index++;
   }
   $output .= '</ul>';
   return $output;
