diff --git a/file_entity_link.module b/file_entity_link.module
index 29f4613..588aa30 100644
--- a/file_entity_link.module
+++ b/file_entity_link.module
@@ -36,7 +36,7 @@ function file_entity_link_file_view($file, $view_mode, $langcode){
   $settings = variable_get(FILE_ENTITY_LINK_SETTINGS_VAR, array());
   if(isset($settings[$file->type][$view_mode]) && $settings[$file->type][$view_mode] && !empty($file->referencing_entity)) {
     $entity_type = '';
-    
+
     // If we are on a Field Collection Item
     if ($file->referencing_entity instanceof FieldCollectionItemEntity) {
       // Load the host entity
@@ -51,25 +51,25 @@ function file_entity_link_file_view($file, $view_mode, $langcode){
         $entity_id = $file->referencing_entity->nid;
       }
       elseif(isset($file->referencing_entity->tid)) {
-        $entity_type = 'node';
+        $entity_type = 'taxonomy_term';
         $entity_id = $file->referencing_entity->tid;
       }
     }
-    
+
     switch ($entity_type) {
       case 'node':
         $path = 'node/' . $entity_id;
         break;
-    
+
       case 'taxonomy_term':
         $path = 'taxonomy/term/' . $entity_id;
         break;
-        
+
       case 'user':
         $path = 'user/' . $entity_id;
         break;
     }
-    
+
     if(!empty($path)) {
       $file->content['file'] = array(
      	'#contents' => $file->content['file'],
