diff --git a/core/includes/errors.inc b/core/includes/errors.inc
index 5fc4b7d..973010e 100644
--- a/core/includes/errors.inc
+++ b/core/includes/errors.inc
@@ -153,7 +153,13 @@ function _drupal_render_exception_safe($exception) {
  *   TRUE if an error should be displayed.
  */
 function error_displayable($error = NULL) {
-  $error_level = config('system.logging')->get('error_level');
+  try {
+    $error_level = config('system.logging')->get('error_level');
+  }
+  catch (Exception $e) {
+    // During very early install the cache_config table does not exist.
+    $error_level = ERROR_REPORTING_DISPLAY_ALL;
+  }
   $updating = (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update');
   $all_errors_displayed = ($error_level == ERROR_REPORTING_DISPLAY_ALL) ||
     ($error_level == ERROR_REPORTING_DISPLAY_VERBOSE);
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 2395f70..cc8cb5a 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1,5 +1,6 @@
 <?php
 
+use Drupal\Core\Config\FileStorage;
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Install\TaskException;
@@ -428,6 +429,16 @@ function install_begin_request(&$install_state) {
     }
   }
 
+  // Ensure that the active configuration directory is empty before installation
+  // starts.
+  if ($install_state['config_verified'] && empty($task)) {
+    $config = glob(config_get_config_directory(CONFIG_ACTIVE_DIRECTORY) . '/*.' . FileStorage::getFileExtension());
+    if (!empty($config)) {
+      $task = NULL;
+      throw new Exception(install_already_done_error());
+    }
+  }
+
   // Modify the installation state as appropriate.
   $install_state['completed_task'] = $task;
   $install_state['database_tables_exist'] = !empty($task);
@@ -1605,7 +1616,7 @@ function install_already_done_error() {
   global $base_url;
 
   drupal_set_title(st('Drupal already installed'));
-  return st('<ul><li>To start over, you must empty your existing database.</li><li>To install to a different database, edit the appropriate <em>settings.php</em> file in the <em>sites</em> folder.</li><li>To upgrade an existing installation, proceed to the <a href="@base-url/core/update.php">update script</a>.</li><li>View your <a href="@base-url">existing site</a>.</li></ul>', array('@base-url' => $base_url));
+  return st('<ul><li>To start over, you must empty your existing database and delete your active configuration.</li><li>To install to a different database, edit the appropriate <em>settings.php</em> file in the <em>sites</em> folder.</li><li>To locate your active configuration, view the appropriate <em>settings.php</em> file in the <em>sites</em> folder.</em></li></li><li>To upgrade an existing installation, proceed to the <a href="@base-url/core/update.php">update script</a>.</li><li>View your <a href="@base-url">existing site</a>.</li></ul>', array('@base-url' => $base_url));
 }
 
 /**
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index a93a124..445b27c 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -397,7 +397,9 @@ function system_requirements($phase) {
       }
     }
     else {
-      if (file_default_scheme() == 'public') {
+      // This function can be called before the config_cache table has been
+      // created.
+      if ($phase == 'install' || file_default_scheme() == 'public') {
         $requirements['file system']['value'] = $t('Writable (<em>public</em> download method)');
       }
       else {
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index bdf5862..46f8807 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -719,6 +719,12 @@ function user_format_name($account) {
 function user_template_preprocess_default_variables_alter(&$variables) {
   global $user;
 
+  // If this function is called from the installer after Drupal has been
+  // installed then $user will not be set.
+  if (!is_object($user)) {
+    return;
+  }
+
   $variables['user'] = clone $user;
   // Remove password and session IDs, since themes should not need nor see them.
   unset($variables['user']->pass, $variables['user']->sid, $variables['user']->ssid);
