diff --git a/plugins/access/term_has_parent.inc b/plugins/access/term_has_parent.inc
index a079e92..8006105 100644
--- a/plugins/access/term_has_parent.inc
+++ b/plugins/access/term_has_parent.inc
@@ -113,29 +113,29 @@ function ctools_term_has_parent_ctools_access_check($conf, $context) {
   }
   $vid = $conf['vid'];
 
-  // we'll start looking up the hierarchy from our context term id.
+  // We'll start looking up the hierarchy from our context term id.
   $current_term = $context->data->tid;
 
   $term='';
 
-  // scan up the tree.
+  // Scan up the tree.
   while (true) {
     // select parent as term_parent to avoid PHP5 complications with the parent keyword
     //@todo: Find a way to reduce the number of queries required for really deep hierarchies.
     $term = db_query("SELECT parent AS term_parent, tid AS tid FROM {taxonomy_term_hierarchy} th WHERE th.tid = :tid", array(':tid'=>$current_term))->fetchObject();
 
-    // if no term is found, get out of the loop
+    // If no term is found, get out of the loop.
     if (!$term || empty($term->tid)) {
       break;
     }
 
-    // check the term selected, if the user asked it to.
-    if (!empty($conf['include_self']) && isset($conf['vid_' . $vid][$term->tid])) {
+    // Check the term selected, if the user asked it to.
+    if (!empty($conf['include_self']) && isset($conf['vid_' . $vid][$context->data->tid])) {
       return TRUE;
     }
 
-    // did we find the parent TID we were looking for?
-    if (isset($conf['vid_' . $vid][$term->tid])) {
+    // Did we find the parent TID we were looking for?
+    if (isset($conf['vid_' . $vid][$term->tid]) && ($term->tid != $context->data->tid)) {
       // YES, we're done!
       return TRUE;
     }
@@ -146,7 +146,7 @@ function ctools_term_has_parent_ctools_access_check($conf, $context) {
       break;
     }
 
-    // update the parent, and keep scanning.
+    // Update the parent, and keep scanning.
     $current_term = $term->term_parent;
   }
 
