diff --git a/relation.rules.inc b/relation.rules.inc
index ecf3658..8083985 100644
--- a/relation.rules.inc
+++ b/relation.rules.inc
@@ -118,8 +118,8 @@ function relation_rules_access($op, $entity = NULL, $account = NULL) {
 function relation_rules_get_endpoints($relation, array $options, $property_name, $entity_type) {
   $array = array();
   foreach ($relation->endpoints[LANGUAGE_NONE] as $endpoint) {
-    $entity = reset(entity_load($endpoint['entity_type'], array($endpoint['entity_id'])));
-    $array[] = entity_metadata_wrapper($endpoint['entity_type'], $entity);
+    $entities = entity_load($endpoint['entity_type'], array($endpoint['entity_id']));
+    $array[] = entity_metadata_wrapper($endpoint['entity_type'], reset($entities));
   }
   return $array;
 }
@@ -142,8 +142,8 @@ function relation_rules_get_specific_endpoints($relation, array $options, $prope
 
   $array = array();
   foreach ($endpoints as $endpoint) {
-    $entity = reset(entity_load($endpoint['entity_type'], array($endpoint['entity_id'])));
-    $entity_id = entity_extract_ids($endpoint['entity_type'], $entity);
+    $entities = entity_load($endpoint['entity_type'], array($endpoint['entity_id']));
+    $entity_id = entity_extract_ids($endpoint['entity_type'], reset($entities));
     $array[] = $entity_id[0];
   }
   return $array;
