diff --git a/core/lib/Drupal/Core/Extension/Extension.php b/core/lib/Drupal/Core/Extension/Extension.php
index 3c765fe..6859601 100644
--- a/core/lib/Drupal/Core/Extension/Extension.php
+++ b/core/lib/Drupal/Core/Extension/Extension.php
@@ -166,8 +166,9 @@ public function __call($method, array $args) {
    * Serializes the Extension object in the most optimized way.
    */
   public function serialize() {
+    // Don't serialize the app root, since this could change if the install is
+    // moved..
     $data = array(
-      'root' => $this->root,
       'type' => $this->type,
       'pathname' => $this->pathname,
       'filename' => $this->filename,
@@ -188,7 +189,8 @@ public function serialize() {
    */
   public function unserialize($data) {
     $data = unserialize($data);
-    $this->root = $data['root'];
+    // Get the app root from the container.
+    $this->root = \Drupal::root();
     $this->type = $data['type'];
     $this->pathname = $data['pathname'];
     $this->filename = $data['filename'];
diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
index d3d103d..dd22488 100644
--- a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
+++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
@@ -173,9 +173,6 @@ protected function setUp() {
     // Add the config directories to settings.php.
     drupal_install_config_directories();
 
-    // Install any additional modules.
-    $this->installModulesFromClassProperty($container);
-
     // Restore the original Simpletest batch.
     $this->restoreBatch();
 
@@ -183,6 +180,7 @@ protected function setUp() {
     $this->rebuildAll();
 
     // Replace User 1 with the user created here.
+    // @todo: do this without saving the user account.
     /** @var \Drupal\user\UserInterface $account */
     $account = User::load(1);
     $account->setPassword($this->rootUser->pass_raw);
@@ -260,7 +258,9 @@ protected function rebuildAll() {
     // We know the rebuild causes notices, so don't exit on failure.
     $die_on_fail = $this->dieOnFail;
     $this->dieOnFail = FALSE;
-    parent::rebuildAll();
+
+    // Initialize the container. parent::rebuildall() is not safe to call here.
+    $this->container = \Drupal::getContainer();
 
     // Remove the notices we get due to the menu link rebuild prior to running
     // the system updates for the schema change.
