diff --git a/src/FeaturesInstallStorage.php b/src/FeaturesInstallStorage.php
index 0691c99..5ad7bb7 100644
--- a/src/FeaturesInstallStorage.php
+++ b/src/FeaturesInstallStorage.php
@@ -97,6 +97,10 @@ class FeaturesInstallStorage extends ExtensionInstallStorage {
    * dependencies between these services and \Drupal\Core\Config\ConfigInstaller
    * and \Drupal\Core\Config\TypedConfigManager.
    *
+   * NOTE: This code is copied from ExtensionInstallStorage::getAllFolders() with
+   * the following changes (Notes in CHANGED below)
+   *   - Load all modules whether installed or not
+   *
    * @return array
    *   An array mapping config object names with directories.
    */
@@ -105,45 +109,86 @@ class FeaturesInstallStorage extends ExtensionInstallStorage {
       $this->folders = array();
       $this->folders += $this->getCoreNames();
 
+      $install_profile = Settings::get('install_profile');
+      $profile = drupal_get_profile();
       $extensions = $this->configStorage->read('core.extension');
-      // Override the module list to include uninstalled modules (exported but
-      // not enabled).
-      $extensions['module'] = $this->getAllModules();
+      // @todo Remove this scan as part of https://www.drupal.org/node/2186491
       $listing = new ExtensionDiscovery(\Drupal::root());
-      if (!empty($extensions['module'])) {
-        $modules = $extensions['module'];
-        if (!$this->includeProfile) {
-          if ($install_profile = Settings::get('install_profile')) {
-            unset($modules[$install_profile]);
+
+      // CHANGED START: Add profile directories for any bundles that use a profile.
+      $profile_directories = [];
+      if ($profile) {
+        $profile_directories[] = drupal_get_path('profile', $profile);
+      }
+      if ($this->includeProfile) {
+        // Add any profiles used in bundles.
+        $assigner = \Drupal::service('features_assigner');
+        $bundles = $assigner->getBundleList();
+        foreach ($bundles as $bundle_name => $bundle) {
+          if ($bundle->isProfile()) {
+            // Register the profile directory.
+            $profile_directory = 'profiles/' . $bundle->getProfileName();
+            if (is_dir($profile_directory)) {
+              $profile_directories[] = $profile_directory;
+            }
           }
         }
+      }
+      $listing->setProfileDirectories($profile_directories);
+      // CHANGED END
+
+      if (!empty($extensions['module'])) {
 
+        // CHANGED START: Find ANY modules, not just enabled ones.
+        //$modules = $extensions['module'];
         $module_list_scan = $listing->scan('module');
-        $module_list = [];
-        foreach (array_keys($modules) as $module) {
+        $modules = $module_list_scan;
+        // CHANGED END
+        
+        // Remove the install profile as this is handled later.
+        unset($modules[$install_profile]);
+        $profile_list = $listing->scan('profile');
+        if ($profile && isset($profile_list[$profile])) {
+          // Prime the drupal_get_filename() static cache with the profile info
+          // file location so we can use drupal_get_path() on the active profile
+          // during the module scan.
+          // @todo Remove as part of https://www.drupal.org/node/2186491
+          drupal_get_filename('profile', $profile, $profile_list[$profile]->getPathname());
+        }
+        $module_list = array();
+        foreach (array_keys($module_list_scan) as $module) {
           if (isset($module_list_scan[$module])) {
             $module_list[$module] = $module_list_scan[$module];
           }
         }
         $this->folders += $this->getComponentNames($module_list);
       }
+      if (!empty($extensions['theme'])) {
+        $theme_list_scan = $listing->scan('theme');
+        foreach (array_keys($extensions['theme']) as $theme) {
+          if (isset($theme_list_scan[$theme])) {
+            $theme_list[$theme] = $theme_list_scan[$theme];
+          }
+        }
+        $this->folders += $this->getComponentNames($theme_list);
+      }
 
-      // DO NOT OVERRIDE PROFILE if includeProfile is false
-      // (which is the default in FeaturesInstallStorage).
       if ($this->includeProfile) {
-        $profile = drupal_get_profile();
         // The install profile can override module default configuration. We do
         // this by replacing the config file path from the module/theme with the
         // install profile version if there are any duplicates.
-        $profile_list = $listing->scan('profile');
-        $profile_folders = $this->getComponentNames(array($profile_list[$profile]));
-        $this->folders = $profile_folders + $this->folders;
-        $folders_to_replace = array_intersect_key($profile_folders, $this->folders);
-        if (!empty($folders_to_replace)) {
-          $this->folders = array_merge($this->folders, $folders_to_replace);
+        if (isset($profile)) {
+          if (!isset($profile_list)) {
+            $profile_list = $listing->scan('profile');
+          }
+          if (isset($profile_list[$profile])) {
+            $profile_folders = $this->getComponentNames(array($profile_list[$profile]));
+            $this->folders = $profile_folders + $this->folders;
+          }
         }
       }
     }
+
     return $this->folders;
   }
 
