diff --git a/plugins/content_types/node_context/node_terms.inc b/plugins/content_types/node_context/node_terms.inc
index 1b9c553..e926c26 100644
--- a/plugins/content_types/node_context/node_terms.inc
+++ b/plugins/content_types/node_context/node_terms.inc
@@ -47,34 +47,26 @@ function ctools_node_terms_content_type_render($subtype, $conf, $panel_args, $co
 
   $terms = array();
 
-  if (empty($conf['vid'])) {
-    // All terms.
-    foreach ($term_objects AS $term) {
+  if (!empty($conf['vid'])) {
+    foreach ($term_objects as $tid => $term) {
+      if ($term->vid != $conf['vid']) {
+        unset($term_objects[$tid]);
+      }
+    }
+  }
+  foreach ($term_objects as $term) {
+    if ($conf['term_format'] == 'term-links') {
       $terms['taxonomy_term_' . $term->tid] = array(
-        'title' => check_plain($term->name),
+        'title' => $term->name,
         'href' => 'taxonomy/term/' . $term->tid,
-        'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))
+        'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)),
       );
     }
-  }
-  else {
-    // They want something special and custom, we'll have to do this ourselves.
-    foreach ($term_objects as $term) {
-      if ($term->vid == $conf['vid']) {
-        if ($conf['term_format'] == 'term-links') {
-          $terms['taxonomy_term_' . $term->tid] = array(
-            'title' => $term->name,
-            'href' => 'taxonomy/term/' . $term->tid,
-            'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)),
-          );
-        }
-        elseif (empty($conf['link'])) {
-          $terms[] = check_plain($term->name);
-        }
-        else {
-          $terms[] = l($term->name, 'taxonomy/term/' . $term->tid, array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
-        }
-      }
+    elseif (empty($conf['link'])) {
+      $terms[] = check_plain($term->name);
+    }
+    else {
+      $terms[] = l($term->name, 'taxonomy/term/' . $term->tid, array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
     }
   }
 
