diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module
index e44cc32..ca89b07 100644
--- a/core/modules/entity_reference/entity_reference.module
+++ b/core/modules/entity_reference/entity_reference.module
@@ -210,6 +210,7 @@ function entity_reference_create_instance($entity_type, $bundle, $field_name, $f
       'name' => $field_name,
       'type' => 'entity_reference',
       'entity_type' => $entity_type,
+      'cardinality' => FieldDefinitionInterface::CARDINALITY_UNLIMITED,
       'settings' => array(
         'target_type' => $target_entity_type,
       ),
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldWidget/AutocompleteWidget.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldWidget/AutocompleteWidget.php
index bcaafaf..a0ec644 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldWidget/AutocompleteWidget.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldWidget/AutocompleteWidget.php
@@ -41,14 +41,15 @@ class AutocompleteWidget extends AutocompleteWidgetBase {
   public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
     // We let the Field API handles multiple values for us, only take care of
     // the one matching our delta.
+    $item = clone $items;
     if (isset($items[$delta])) {
-      $items->setValue(array($items[$delta]->getValue()));
+      $item->setValue(array($items[$delta]->getValue()));
     }
     else {
-      $items->setValue(array());
+      $item->setValue(array());
     }
 
-    return parent::formElement($items, $delta, $element, $form, $form_state);
+    return parent::formElement($item, $delta, $element, $form, $form_state);
   }
 
   /**
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceWidgetTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceWidgetTest.php
new file mode 100644
index 0000000..f4a71f17
--- /dev/null
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceWidgetTest.php
@@ -0,0 +1,113 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\entity_reference\Tests\EntityReferenceWidgetTest.
+ */
+
+namespace Drupal\entity_reference\Tests;
+
+use Drupal\system\Tests\Entity\EntityUnitTestBase;
+use Drupal\entity_reference\ConfigurableEntityReferenceItem;
+
+/**
+ * Tests Entity Reference formatters.
+ */
+class EntityReferenceWidgetTest extends EntityUnitTestBase {
+
+  /**
+   * The entity type used in this test.
+   *
+   * @var string
+   */
+  protected $entityType = 'entity_test';
+
+  /**
+   * The bundle used in this test.
+   *
+   * @var string
+   */
+  protected $bundle = 'entity_test';
+
+  /**
+   * The name of the field used in this test.
+   *
+   * @var string
+   */
+  protected $fieldName = 'field_test';
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('entity_reference');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Entity reference widgets',
+      'description' => 'Tests the widgets functionality.',
+      'group' => 'Entity Reference',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp();
+
+    entity_reference_create_instance($this->entityType, $this->bundle, $this->fieldName, 'Field test', $this->entityType);
+  }
+
+  /**
+   * Assert unaccessible items don't change the data of the fields.
+   */
+  public function testValues() {
+    // Prepares test data.
+    $parent_entity = entity_create(
+      $this->entityType,
+      array(
+        'name' => $this->randomName()
+      )
+    );
+    foreach (range(0, 3) as $delta) {
+      $entity = entity_create(
+        $this->entityType,
+        array(
+          'name' => $this->randomName()
+        )
+      );
+      $entity->save();
+      $parent_entity->{$this->fieldName}[$delta]->entity = $entity;
+    }
+    $parent_entity->save();
+    $widget_manager = \Drupal::service('plugin.manager.field.widget');
+    $widget = $widget_manager->getInstance(array('field_definition' => $parent_entity->{$this->fieldName}->getFieldDefinition()));
+    $entity_loaded = entity_load($this->entityType, $parent_entity->id());
+
+    // Renders prepared data.
+    $element = array (
+      '#parents' => array(
+        'default_value_input'
+      ),
+    );
+    $form_state = array();
+    $form = $widget->form($entity_loaded->{$this->fieldName}, $element, $form_state);
+
+    // Checks.
+    $is_filled = TRUE;
+    foreach ($entity_loaded->{$this->fieldName} as $delta => $entity_reference) {
+      if (array_key_exists($delta, $form['field_test']['widget'])) {
+        if ($entity_reference->target_id == NULL) {
+          continue;
+        }
+        $entity = entity_load($this->entityType, $entity_reference->target_id);
+        $input_value = $form['field_test']['widget'][$delta]['target_id']['#default_value'];
+        $entity_value = $entity->label() . ' (' . $entity->id() . ')';
+        $this->assertEqual($input_value, $entity_value);
+      } else {
+        $is_filled = FALSE;
+        break;
+      }
+    }
+    $this->assertTrue($is_filled);
+  }
+}
