diff --git a/plugins/contexts/entity.inc b/plugins/contexts/entity.inc
index b214aa0..ee8b85f 100644
--- a/plugins/contexts/entity.inc
+++ b/plugins/contexts/entity.inc
@@ -76,10 +76,10 @@ function ctools_context_create_entity($empty, $data = NULL, $conf = FALSE, $plug
     $ids = entity_extract_ids($entity_type, $data);
     $id = $ids[0];
   }
-  elseif (is_numeric($data)) {
+  elseif (is_numeric($data) || (!empty($entity['entity keys']['name']) && is_string($data))) {
     $id = $data;
     $data = entity_load($entity_type, array($id));
-    $data = !empty($data[$id]) ? $data[$id] : FALSE;
+    $data = reset($data);
   }
 
   if (is_array($data)) {
