diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module
index 84d4743..8c34308 100644
--- a/core/modules/entity_reference/entity_reference.module
+++ b/core/modules/entity_reference/entity_reference.module
@@ -120,7 +120,7 @@ function entity_reference_field_presave(EntityInterface $entity, $field, $instan
 function entity_reference_field_validate(EntityInterface $entity = NULL, $field, $instance, $langcode, $items, &$errors) {
   $ids = array();
   foreach ($items as $delta => $item) {
-    if (!empty($item['target_id']) && !$item['entity'] && !$item['entity']->isNew()) {
+    if (!empty($item['target_id']) && (!empty($item['entity']) && !$item['entity']->isNew())) {
       $ids[$item['target_id']] = $delta;
     }
   }
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
index 97aeb6e..c794230 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
@@ -258,11 +258,12 @@ public function validateAutocompleteInput($input, &$element, &$form_state, $form
    */
   public function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
     $target_type = $this->fieldDefinition->getFieldSetting('target_type');
+    $handler_settings = $this->fieldDefinition->getFieldSetting('handler_settings');
     $entity_info = entity_get_info($target_type);
 
     $query = \Drupal::entityQuery($target_type);
-    if (!empty($this->instance['settings']['handler_settings']['target_bundles'])) {
-      $query->condition($entity_info['entity_keys']['bundle'], $this->instance['settings']['handler_settings']['target_bundles'], 'IN');
+    if (!empty($handler_settings['target_bundles'])) {
+      $query->condition($entity_info['entity_keys']['bundle'], $handler_settings['target_bundles'], 'IN');
     }
 
     if (isset($match) && isset($entity_info['entity_keys']['label'])) {
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php
index 51f5285..af3774a 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceFormatterBase.php
@@ -40,7 +40,7 @@ public function prepareView(array $entities, $langcode, array &$items) {
       }
     }
 
-    $target_type = $this->field['settings']['target_type'];
+    $target_type = $this->getFieldSetting('target_type');
 
     $target_entities = array();
 
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
index 440b626..2b354cf 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
@@ -138,7 +138,7 @@ protected function createNewEntity($label, $uid) {
     $target_bundles = $this->getSelectionHandlerSetting('target_bundles');
 
     // Get the bundle.
-    if (!empty($target_bundles) && count($target_bundles) == 1) {
+    if (!empty($target_bundles)) {
       $bundle = reset($target_bundles);
     }
     else {
