diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
index dee07c1..5c73f8b 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
@@ -62,7 +62,13 @@ protected function doCreate(array $values) {
       if (!isset($values[$this->bundleKey])) {
         throw new EntityStorageException(String::format('Missing bundle for entity type @type', array('@type' => $this->entityTypeId)));
       }
-      $bundle = $values[$this->bundleKey];
+
+      if (is_array($values[$this->bundleKey])) {
+        $bundle = $values[$this->bundleKey][0]['target_id'];
+      }
+      else {
+        $bundle = $values[$this->bundleKey];
+      }
     }
     $entity = new $this->entityClass(array(), $this->entityTypeId, $bundle);
 
