diff --git a/quicktabs.classes.inc b/quicktabs.classes.inc
index 6dfe148..3819684 100644
--- a/quicktabs.classes.inc
+++ b/quicktabs.classes.inc
@@ -188,7 +188,8 @@ class QuickSet {
       $renderable_contents = 0;
       foreach ($this->contents as $key => $tab) {
         $contents = $tab->render(TRUE);
-        if (empty($contents)) {
+        reset($contents);
+        if (empty($contents[key($contents)]['#markup'])) {
           // Rather than removing the item, we set it to NULL. This way we retain
           // the same indices across tabs, so that permanent links to particular
           // tabs can be relied upon.
