diff --git a/eva.module b/eva.module
index 4a32781..7ebd814 100755
--- a/eva.module
+++ b/eva.module
@@ -19,7 +19,7 @@ function eva_views_api() {
 function eva_field_extra_fields() {
   $extras = array();
   $views = eva_get_views();
-  
+
   foreach ($views as $entity => $data) {
     foreach ($data as $view) {
       if ($view['bundles']) {
@@ -31,14 +31,14 @@ function eva_field_extra_fields() {
       }
       foreach ($bundles as $bundle) {
         $extras[$entity][$bundle]['display'][$view['name'] . '_' . $view['display']] = array(
-          'label' => (empty($view['title'])) ? $view['name'] : $view['title'], 
-          'description' => $view['title'], 
+          'label' => (empty($view['title'])) ? $view['name'] : $view['title'],
+          'description' => $view['title'],
           'weight' => 10,
         );
         // Provide a separate extra field for the exposed form if there is any.
         if (!empty($view['exposed form']) && !empty($view['exposed form split'])) {
           $extras[$entity][$bundle]['display'][$view['name'] . '_' . $view['display'] . '_' . 'form'] = array(
-            'label' => ((empty($view['title'])) ? $view['name'] : $view['title']) . ' (' . t('Exposed form') . ')', 
+            'label' => ((empty($view['title'])) ? $view['name'] : $view['title']) . ' (' . t('Exposed form') . ')',
             'description' => t('The exposed filter form of the view.'),
             'weight' => 9,
           );
@@ -56,46 +56,57 @@ function eva_field_extra_fields() {
  * This is a terrible, terrible hack that should not be necessary; taxonomy and
  * some other entity types use fields, but don't implement  hook_entity_view().
  * We have to ALTER those entity types after they're built. For the time being,
- * we'll use a list of special cases to trigger this special handling. 
+ * we'll use a list of special cases to trigger this special handling.
  */
 function eva_entity_view_alter(&$build, $type) {
   $view_mode = $build['#view_mode'];
   $language = $build['#language'];
 
   $entity_data = entity_get_info($type);
-  $entity = _eva_extract_entity_from_build($build);
-
-  $entity_ids = entity_extract_ids($type, $entity);
-  $settings = field_view_mode_settings($type, $entity_ids[2]);
-  $fields = field_extra_fields_get_display($type, $entity_ids[2], $view_mode);
+  $entity = _eva_extract_entity_from_build($build, $type);
   $views = eva_get_views($type);
 
-  foreach ($views as $info) {
-    $longname = $info['name'] .'_'. $info['display'];
-    if (isset($fields[$longname]) && $fields[$longname]['visible']) {
-      if ($view = views_get_view($info['name'])) {
-        $view->set_display($info['display']);
-        if ($view->access($info['display'])) {
-          $view->current_entity = $entity;
-
-          if (isset($fields[$longname . '_form']) && $fields[$longname . '_form']['visible']) {
-            $view->init_handlers();
-            $exposed_form = $view->display_handler->get_plugin('exposed_form');
-
-            $build[$longname . '_form'] = array(
-              '#markup' => $exposed_form->render_exposed_form(TRUE),
-            );
-          }
-          $result = $view->execute_display($info['display']);
-          if (!empty($result)) {
-            $build[$longname] = array(
-              '#markup' => $result,
-              '#weight' => $fields[$longname]['weight'],
-            );
+  // Check to make sure we have at least 1 view to display
+  if ($views) {
+    // If we've found an entity in the build array, gather field information.
+    if (!empty($entity)) {
+      $entity_ids = entity_extract_ids($type, $entity);
+      $settings = field_view_mode_settings($type, $entity_ids[2]);
+      $fields = field_extra_fields_get_display($type, $entity_ids[2], $view_mode);
+
+      foreach ($views as $info) {
+        $longname = $info['name'] .'_'. $info['display'];
+        if (isset($fields[$longname]) && $fields[$longname]['visible']) {
+          if ($view = views_get_view($info['name'])) {
+            $view->set_display($info['display']);
+            if ($view->access($info['display'])) {
+              $view->current_entity = $entity;
+
+              if (isset($fields[$longname . '_form']) && $fields[$longname . '_form']['visible']) {
+                $view->init_handlers();
+                $exposed_form = $view->display_handler->get_plugin('exposed_form');
+
+                $build[$longname . '_form'] = array(
+                  '#markup' => $exposed_form->render_exposed_form(TRUE),
+                );
+              }
+              $result = $view->execute_display($info['display']);
+              if (!empty($result)) {
+                $build[$longname] = array(
+                  '#markup' => $result,
+                  '#weight' => $fields[$longname]['weight'],
+                );
+              }
+            }
           }
         }
       }
     }
+
+    // If we didn't find the entity in the build array, let the user know.
+    else {
+      watchdog('eva', t('EVA could not find the entity in its build array. View was not attached to entity of type %type', array('%type' => $type)), WATCHDOG_ERROR);
+    }
   }
 }
 
@@ -118,7 +129,7 @@ function eva_get_views($type = NULL, $reset = FALSE) {
 
   if (!isset($used_views) || $reset) {
     views_include('cache');
-    
+
     // If we're not resetting, check the Views cache.
     if (!$reset) {
       $cache = views_cache_get("eva");
@@ -178,23 +189,24 @@ function eva_get_views($type = NULL, $reset = FALSE) {
  *
  * I hate you, Milkman Dan.
  */
-function _eva_extract_entity_from_build($build) {
+function _eva_extract_entity_from_build($build, $type = NULL) {
+  $build_paths = array(
+    'user' => '#account',
+    'taxonomy_term' => '#term',
+  );
+  drupal_alter('eva_build_path', $build_paths);
+  if (!empty($build_paths[$type])) {
+    return $build[$build_paths[$type]];
+  }
+
   // EntityAPI often sticks stuff in here.
-  if (!empty($build['#entity'])) {
+  else if (!empty($build['#entity'])) {
     return $build['#entity'];
   }
-  
-  // Other entities stick them here!
-  elseif (!empty($build['#' . $build['#entity_type']])) {
-    return $build['#' . $build['#entity_type']];
-  }
 
-  // Some entities are naughty.
-  elseif ($build['#entity_type'] == 'user') {
-    return $build['#account'];
-  }
-  elseif ($build['#entity_type'] == 'taxonomy_term') {
-    return $build['#term'];
+  // Other entities stick them here!
+  elseif (!empty($build['#' . $type])) {
+    return $build['#' . $type];
   }
 
   return FALSE;
@@ -250,4 +262,4 @@ function eva_form_views_ui_edit_form_alter(&$form, &$form_state, $form_id) {
   // Clear the field cache when views are saved. This will make sure newly
   // created EVA views and/or exposed filters will appear.
   $form['actions']['save']["#submit"][] = 'field_cache_clear';
-}
\ No newline at end of file
+}
