diff --git a/efq_extra_field.module b/efq_extra_field.module
index 9cfcd8e..ab126ff 100644
--- a/efq_extra_field.module
+++ b/efq_extra_field.module
@@ -86,23 +86,31 @@ class EntityFieldQueryExtraFields extends EntityFieldQuery {
     foreach ($select_query->execute() as $partial_entity) {
       $bundle = isset($partial_entity->bundle) ? $partial_entity->bundle : NULL;
       $entity = entity_create_stub_entity($partial_entity->entity_type, array($partial_entity->entity_id, $partial_entity->revision_id, $bundle));
-      // This is adding the file id using our metaData field.
       $entity->extraFields = $partial_entity;
 
-      // if the id already exists, merge the data in a smart way. This
-      // is completely based on the assumption that we expect a similar entity
+      // If the id already exists, merge the data in a smart way. This
+      // is completely based on the assumption that we expect a similar entity.
       if (isset($return[$partial_entity->entity_type][$partial_entity->$id_key])) {
         $previous_entity = $return[$partial_entity->entity_type][$partial_entity->$id_key];
         foreach ($previous_entity->extraFields as $id => $child) {
-          // if the key is the same but the value is not, make it into an array
-          if ($entity->extraFields->{$id} != $previous_entity->extraFields->{$id}) {
-            $result = array($entity->extraFields->{$id}, $previous_entity->extraFields->{$id});
-            $entity->extraFields->{$id} = $result;
+          // Found a distinct value, make it into an array.
+          if (!is_array($previous_entity->extraFields->{$id})) {
+            if ($entity->extraFields->{$id} != $previous_entity->extraFields->{$id}) {
+              $entity->extraFields->{$id} = array($previous_entity->extraFields->{$id}, $entity->extraFields->{$id});
+            }
+          }
+          // Found more distinct values. Append to the array. Avoid duplicates.
+          else {
+            if (!in_array($entity->extraFields->{$id}, $previous_entity->extraFields->{$id})) {
+              $value = $previous_entity->extraFields->{$id};
+              $value[] = $entity->extraFields->{$id};
+              $entity->extraFields->{$id} = $value;
+            }
           }
         }
       }
 
-      // Add the entitiy to the result set to return
+      // Add the entity to the result set to return.
       $return[$partial_entity->entity_type][$partial_entity->$id_key] = $entity;
       $this->ordered_results[] = $partial_entity;
     }
@@ -166,4 +174,4 @@ class EntityFieldQueryExtraFields extends EntityFieldQuery {
     }
     return FALSE;
   }
-}
\ No newline at end of file
+}
