diff --git a/core/lib/Drupal/Core/Config/Schema/Mapping.php b/core/lib/Drupal/Core/Config/Schema/Mapping.php
index a85fac4..eed1da8 100644
--- a/core/lib/Drupal/Core/Config/Schema/Mapping.php
+++ b/core/lib/Drupal/Core/Config/Schema/Mapping.php
@@ -88,7 +88,7 @@ public function set($property_name, $value, $notify = TRUE) {
     if ($notify && isset($this->parent)) {
       $this->parent->onChange($this->name);
     }
-    return $property;
+    return $this;
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
index 826193b..b776608 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -375,9 +375,9 @@ protected function getTranslatedField($name, $langcode) {
    * {@inheritdoc}
    */
   public function set($name, $value, $notify = TRUE) {
-    // If default language or an entity key changes we need to react to that.
-    $notify = $name == 'langcode' || in_array($name, $this->getEntityType()->getKeys());
-    $this->get($name)->setValue($value, $notify);
+    $this->get($name)->setValue($value, FALSE);
+    // Directly notify ourselves, so we can take changes into account.
+    $this->onChange($name);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
index 0fb2330..bbcb0bb 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
@@ -105,7 +105,8 @@ public function set($property_name, $value, $notify = TRUE) {
       throw new \InvalidArgumentException(String::format('Unable to set unknown property @name.', array('@name' => $property_name)));
     }
     // This will throw an exception for unknown fields.
-    return $this->entity->set($property_name, $value, $notify);
+    $this->entity->set($property_name, $value, $notify);
+    return $this;
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Field/FieldItemBase.php b/core/lib/Drupal/Core/Field/FieldItemBase.php
index db8601c..62d1a3d 100644
--- a/core/lib/Drupal/Core/Field/FieldItemBase.php
+++ b/core/lib/Drupal/Core/Field/FieldItemBase.php
@@ -165,6 +165,7 @@ public function set($property_name, $value, $notify = TRUE) {
     if ($notify) {
       $this->onChange($property_name);
     }
+    return $this;
   }
 
   /**
@@ -190,23 +191,26 @@ public function __isset($name) {
    * {@inheritdoc}
    */
   public function __unset($name) {
-    $this->set($name, NULL);
-    unset($this->values[$name]);
+    if ($this->definition->getPropertyDefinition($name)) {
+      $this->set($name, NULL);
+    }
+    else {
+      // Explicitly unset the property in $this->values if a non-defined
+      // property is unset, such that its key is removed from $this->values.
+      unset($this->values[$name]);
+    }
   }
 
   /**
-   * Overrides \Drupal\Core\TypedData\Map::onChange().
+   * {@inheritdoc}
    */
-  public function onChange($property_name) {
-    // Notify the parent of changes.
-    if (isset($this->parent)) {
-      $this->parent->onChange($this->name);
-    }
+  public function onChange($property_name, $notify = TRUE) {
     // Remove the plain value, such that any further __get() calls go via the
     // updated property object.
     if (isset($this->properties[$property_name])) {
       unset($this->values[$property_name]);
     }
+    parent::onChange($property_name, $notify);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
index a6c6bed..317befd 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
@@ -175,7 +175,11 @@ public function getValue($include_computed = FALSE) {
   /**
    * {@inheritdoc}
    */
-  public function onChange($property_name) {
+  public function onChange($property_name, $notify = TRUE) {
+    // Let the parent class do its work first, such that $this->values and
+    // $this->properties are in sync.
+    parent::onChange($property_name, FALSE);
+
     // Make sure that the target ID and the target property stay in sync.
     if ($property_name == 'target_id') {
       $this->properties['entity']->setValue($this->target_id, FALSE);
@@ -183,7 +187,11 @@ public function onChange($property_name) {
     elseif ($property_name == 'entity') {
       $this->set('target_id', $this->properties['entity']->getTargetIdentifier(), FALSE);
     }
-    parent::onChange($property_name);
+
+    // Notify the parent of changes.
+    if (isset($this->parent) && $notify) {
+      $this->parent->onChange($this->name);
+    }
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
index 961eb67..7d0329b 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
@@ -100,7 +100,11 @@ public function applyDefaultValue($notify = TRUE) {
   /**
    * {@inheritdoc}
    */
-  public function onChange($property_name) {
+  public function onChange($property_name, $notify = TRUE) {
+    // Let the parent class do its work first, such that $this->values and
+    // $this->properties are in sync.
+    parent::onChange($property_name, FALSE);
+
     // Make sure that the value and the language property stay in sync.
     if ($property_name == 'value') {
       $this->properties['language']->setValue($this->value, FALSE);
@@ -108,6 +112,11 @@ public function onChange($property_name) {
     elseif ($property_name == 'language') {
       $this->set('value', $this->properties['language']->getTargetIdentifier(), FALSE);
     }
-    parent::onChange($property_name);
+
+    // Notify the parent of changes.
+    if (isset($this->parent) && $notify) {
+      $this->parent->onChange($this->name);
+    }
   }
+
 }
diff --git a/core/lib/Drupal/Core/TypedData/ComplexDataInterface.php b/core/lib/Drupal/Core/TypedData/ComplexDataInterface.php
index e7b91fc..b60f84d 100644
--- a/core/lib/Drupal/Core/TypedData/ComplexDataInterface.php
+++ b/core/lib/Drupal/Core/TypedData/ComplexDataInterface.php
@@ -53,8 +53,7 @@ public function get($property_name);
    *   TRUE. If the update stems from a parent object, set it to FALSE to avoid
    *   being notified again.
    *
-   * @return \Drupal\Core\TypedData\TypedDataInterface
-   *   The property object.
+   * @return $this
    *
    * @throws \InvalidArgumentException
    *   If the specified property does not exist.
diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php
index abb1c9c..408c0cc 100644
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php
@@ -148,6 +148,7 @@ public function set($property_name, $value, $notify = TRUE) {
         $this->onChange($property_name, $value);
       }
     }
+    return $this;
   }
 
   /**
@@ -212,11 +213,16 @@ public function __clone() {
   }
 
   /**
-   * Implements \Drupal\Core\TypedData\ComplexDataInterface::onChange().
+   * {@inheritdoc}
+   *
+   * @param bool $notify
+   *   (optional) Whether to forward the notification to the parent. Defaults to
+   *   TRUE. By passing FALSE overriding implementations can re-use the logic
+   *   of parent classes without triggering the parent notification.
    */
-  public function onChange($property_name) {
+  public function onChange($property_name, $notify = TRUE) {
     // Notify the parent of changes.
-    if (isset($this->parent)) {
+    if (isset($this->parent) && $notify) {
       $this->parent->onChange($this->name);
     }
   }
diff --git a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
index f63ffd6..6ecf319 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
@@ -131,13 +131,12 @@ public function isEmpty() {
   /**
    * {@inheritdoc}
    */
-  public function onChange($property_name) {
-    parent::onChange($property_name);
-
+  public function onChange($property_name, $notify = TRUE) {
     // Enforce that the computed date is recalculated.
     if ($property_name == 'value') {
       $this->date = NULL;
     }
+    parent::onChange($property_name, $notify);
   }
 
 }
diff --git a/core/modules/system/src/Tests/Entity/EntityFieldTest.php b/core/modules/system/src/Tests/Entity/EntityFieldTest.php
index 41dbb44..45709b9 100644
--- a/core/modules/system/src/Tests/Entity/EntityFieldTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityFieldTest.php
@@ -130,16 +130,16 @@ protected function doTestReadWrite($entity_type) {
     $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
 
     // Change the assigned user by entity.
-    $new_user = $this->createUser();
-    $entity->user_id->entity = $new_user;
-    $this->assertEqual($new_user->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
+    $new_user1 = $this->createUser();
+    $entity->user_id->entity = $new_user1;
+    $this->assertEqual($new_user1->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user1->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
 
     // Change the assigned user by id.
-    $new_user = $this->createUser();
-    $entity->user_id->target_id = $new_user->id();
-    $this->assertEqual($new_user->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
+    $new_user2 = $this->createUser();
+    $entity->user_id->target_id = $new_user2->id();
+    $this->assertEqual($new_user2->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user2->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
 
     // Try unsetting a field.
     $entity->name->value = NULL;
@@ -148,6 +148,34 @@ protected function doTestReadWrite($entity_type) {
     $this->assertNull($entity->user_id->target_id, format_string('%entity_type: User ID field is not set.', array('%entity_type' => $entity_type)));
     $this->assertNull($entity->user_id->entity, format_string('%entity_type: User entity field is not set.', array('%entity_type' => $entity_type)));
 
+    // Test setting the values via the typed data API works as well.
+    // Change the assigned user by entity.
+    $entity->user_id->first()->get('entity')->setValue($new_user2);
+    $this->assertEqual($new_user2->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user2->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
+
+     // Change the assigned user by id.
+    $entity->user_id->first()->get('target_id')->setValue($new_user2->id());
+    $this->assertEqual($new_user2->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user2->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
+
+    // Try unsetting a field.
+    $entity->name->first()->get('value')->setValue(NULL);
+    $entity->user_id->first()->get('target_id')->setValue(NULL);
+    $this->assertNull($entity->name->value, format_string('%entity_type: Name field is not set.', array('%entity_type' => $entity_type)));
+    $this->assertNull($entity->user_id->target_id, format_string('%entity_type: User ID field is not set.', array('%entity_type' => $entity_type)));
+    $this->assertNull($entity->user_id->entity, format_string('%entity_type: User entity field is not set.', array('%entity_type' => $entity_type)));
+
+    // Create a fresh entity so target_id does not get its property object
+    // instantiated, then verify setting a new value via typed data API works.
+    $entity2 = entity_create($entity_type, array(
+      'user_id' => array('target_id' => $new_user1->id()),
+    ));
+    // Access the property object, and set a value.
+    $entity2->user_id->first()->get('target_id')->setValue($new_user2->id());
+    $this->assertEqual($new_user2->id(), $entity2->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user2->name->value, $entity2->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
+
     // Test using isset(), empty() and unset().
     $entity->name->value = 'test unset';
     unset($entity->name->value);
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
index e08f951..17b7ef0 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
@@ -59,12 +59,7 @@ public function isEmpty() {
   /**
    * {@inheritdoc}
    */
-  public function onChange($property_name) {
-    // Notify the parent of changes.
-    if (isset($this->parent)) {
-      $this->parent->onChange($this->name);
-    }
-
+  public function onChange($property_name, $notify = TRUE) {
     // Unset processed properties that are affected by the change.
     foreach ($this->definition->getPropertyDefinitions() as $property => $definition) {
       if ($definition->getClass() == '\Drupal\text\TextProcessed') {
@@ -73,6 +68,7 @@ public function onChange($property_name) {
         }
       }
     }
+    parent::onChange($property_name, $notify);
   }
 
   /**
