diff --git a/core/core.services.yml b/core/core.services.yml
index f306a0d..4c3868b 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -374,8 +374,6 @@ services:
     arguments: ['@config.factory']
   request_stack:
     class: Symfony\Component\HttpFoundation\RequestStack
-    tags:
-      - { name: persist }
   current_route_match:
      class: Drupal\Core\Routing\CurrentRouteMatch
      arguments: ['@request_stack']
@@ -455,8 +453,6 @@ services:
     arguments: ['@database']
   router.request_context:
     class: Drupal\Core\Routing\RequestContext
-    tags:
-      - { name: persist }
     calls:
       - [fromRequestStack, ['@request_stack']]
   router.admin_context:
diff --git a/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php
index d4ae53e..0b5bbbf 100644
--- a/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php
+++ b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php
@@ -86,6 +86,10 @@ public function load($file)
 
         // parameters
         if (isset($content['parameters'])) {
+            if (!is_array($content['parameters'])) {
+                throw new InvalidArgumentException(sprintf('The "parameters" key should contain an array in %s. Check your YAML syntax.', $file));
+            }
+
             foreach ($content['parameters'] as $key => $value) {
                 $this->container->setParameter($key, $this->resolveServices($value));
             }
@@ -111,6 +115,10 @@ private function parseDefinitions($content, $file)
             return;
         }
 
+        if (!is_array($content['services'])) {
+            throw new InvalidArgumentException(sprintf('The "services" key should contain an array in %s. Check your YAML syntax.', $file));
+        }
+
         foreach ($content['services'] as $id => $service) {
             $this->parseDefinition($id, $service, $file);
         }
@@ -131,8 +139,14 @@ private function parseDefinition($id, $service, $file)
             $this->container->setAlias($id, substr($service, 1));
 
             return;
-        } elseif (isset($service['alias'])) {
-            $public = !array_key_exists('public', $service) || (Boolean) $service['public'];
+        }
+
+        if (!is_array($service)) {
+            throw new InvalidArgumentException(sprintf('A service definition must be an array or a string starting with "@" but %s found for service "%s" in %s. Check your YAML syntax.', gettype($service), $id, $file));
+        }
+
+        if (isset($service['alias'])) {
+            $public = !array_key_exists('public', $service) || (bool) $service['public'];
             $this->container->setAlias($id, new Alias($service['alias'], $public));
 
             return;
@@ -205,6 +219,10 @@ private function parseDefinition($id, $service, $file)
         }
 
         if (isset($service['calls'])) {
+            if (!is_array($service['calls'])) {
+                throw new InvalidArgumentException(sprintf('Parameter "calls" must be an array for service "%s" in %s. Check your YAML syntax.', $id, $file));
+            }
+
             foreach ($service['calls'] as $call) {
                 $args = isset($call[1]) ? $this->resolveServices($call[1]) : array();
                 $definition->addMethodCall($call[0], $args);
@@ -213,10 +231,14 @@ private function parseDefinition($id, $service, $file)
 
         if (isset($service['tags'])) {
             if (!is_array($service['tags'])) {
-                throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s.', $id, $file));
+                throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s. Check your YAML syntax.', $id, $file));
             }
 
             foreach ($service['tags'] as $tag) {
+                if (!is_array($tag)) {
+                    throw new InvalidArgumentException(sprintf('A "tags" entry must be an array for service "%s" in %s. Check your YAML syntax.', $id, $file));
+                }
+
                 if (!isset($tag['name'])) {
                     throw new InvalidArgumentException(sprintf('A "tags" entry is missing a "name" key for service "%s" in %s.', $id, $file));
                 }
@@ -226,7 +248,7 @@ private function parseDefinition($id, $service, $file)
 
                 foreach ($tag as $attribute => $value) {
                     if (!is_scalar($value) && null !== $value) {
-                        throw new InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s" in %s.', $id, $name, $attribute, $file));
+                        throw new InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s" in %s. Check your YAML syntax.', $id, $name, $attribute, $file));
                     }
                 }
 
@@ -234,6 +256,11 @@ private function parseDefinition($id, $service, $file)
             }
         }
 
+        if (isset($service['decorates'])) {
+            $renameId = isset($service['decoration_inner_name']) ? $service['decoration_inner_name'] : null;
+            $definition->setDecoratedService($service['decorates'], $renameId);
+        }
+
         $this->container->setDefinition($id, $definition);
     }
 
@@ -243,6 +270,8 @@ private function parseDefinition($id, $service, $file)
      * @param string $file
      *
      * @return array The file content
+     *
+     * @throws InvalidArgumentException when the given file is not a local file or when it does not exist
      */
     protected function loadFile($file)
     {
@@ -274,7 +303,7 @@ private function validate($content, $file)
         }
 
         if (!is_array($content)) {
-            throw new InvalidArgumentException(sprintf('The service file "%s" is not valid: it is not an array.', $file));
+            throw new InvalidArgumentException(sprintf('The service file "%s" is not valid. It should contain an array. Check your YAML syntax.', $file));
         }
 
         if ($invalid_keys = array_diff_key($content, array('parameters' => 1, 'services' => 1))) {
@@ -287,9 +316,9 @@ private function validate($content, $file)
     /**
      * Resolves services.
      *
-     * @param string $value
+     * @param string|array $value
      *
-     * @return Reference
+     * @return array|string|Reference
      */
     private function resolveServices($value)
     {
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 600fd21..00b9f9f 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -931,7 +931,7 @@ protected function initializeCookieGlobals(Request $request) {
    */
   protected function getServicesToPersist(ContainerInterface $container) {
     $persist = array();
-    foreach ($container->getParameter('persistIds') as $id) {
+    foreach ($container->getParameter('syntheticIds') as $id) {
       // It's pointless to persist services not yet initialized.
       if ($container->initialized($id)) {
         $persist[$id] = $container->get($id);
@@ -988,6 +988,22 @@ protected function attachSynthetic(ContainerInterface $container) {
 
     // Set the class loader which was registered as a synthetic service.
     $container->set('class_loader', $this->classLoader);
+
+    // Restore request stack.
+    if (isset($this->container)) {
+      $requests = [];
+
+      $original_request_stack = clone $this->container->get('request_stack');
+      while ($request = $original_request_stack->pop()) {
+        $requests[] = $request;
+      }
+
+      while ($request = array_shift($requests)) {
+        $container->get('request_stack')->push($request);
+        $container->get('router.request_context')->fromRequest($request);
+      }
+    }
+
     return $container;
   }
 
@@ -1071,17 +1087,16 @@ protected function compileContainer() {
       }
     }
 
-    // Identify all services whose instances should be persisted when rebuilding
-    // the container during the lifetime of the kernel (e.g., during a kernel
-    // reboot). Include synthetic services, because by definition, they cannot
-    // be automatically reinstantiated. Also include services tagged to persist.
-    $persist_ids = array();
+    // Identify all synthetic services whose instances need to be persisted when
+    // rebuilding the container during the lifetime of the kernel (e.g., during
+    // a kernel reboot).
+    $synthetic_ids = array();
     foreach ($container->getDefinitions() as $id => $definition) {
-      if ($definition->isSynthetic() || $definition->getTag('persist')) {
-        $persist_ids[] = $id;
+      if ($definition->isSynthetic()) {
+        $synthetic_ids[] = $id;
       }
     }
-    $container->setParameter('persistIds', $persist_ids);
+    $container->setParameter('syntheticIds', $synthetic_ids);
 
     $container->compile();
     return $container;
diff --git a/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php b/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php
index 6e93561..4071100 100644
--- a/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php
+++ b/core/lib/Drupal/Core/Installer/InstallerServiceProvider.php
@@ -71,16 +71,6 @@ public function alter(ContainerBuilder $container) {
     // ConfigFactory would to try to load language overrides and InstallStorage
     // throws an exception upon trying to load a non-existing file.
     $container->get('config.factory')->setOverrideState(FALSE);
-
-    // No service may persist when the early installer kernel is rebooted into
-    // the production environment.
-    // @todo The DrupalKernel reboot performed by drupal_install_system() is
-    //   actually not a "regular" reboot (like ModuleHandler::install()), so
-    //   services are not actually persisted.
-    foreach ($container->findTaggedServiceIds('persist') as $id => $tags) {
-      $definition = $container->getDefinition($id);
-      $definition->clearTag('persist');
-    }
   }
 
 }
