diff --git a/.gitignore b/.gitignore
index 4c3a9f0..86b6c60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@
 /testsuite/makewith/io/TestIO.conf
 /testsuite/makewith/unsafeio/Unsafe.conf
 /.stack-work/
+/dist-newstyle/
\ No newline at end of file
diff --git a/src/System/Plugins/Env.hs b/src/System/Plugins/Env.hs
index 4285a1a..f63b318 100644
--- a/src/System/Plugins/Env.hs
+++ b/src/System/Plugins/Env.hs
@@ -331,14 +331,14 @@ union ls ps' =
         in foldr addOnePkg fm ps' : ls
     where
       -- we add each package with and without it's version number and with the full installedPackageId
-      addOnePkg p fm' = addToPkgEnvs (addToPkgEnvs (addToPkgEnvs fm' (display $ sourcePackageId p) p) (display $ installedPackageId p) p)
+      addOnePkg p fm' = addToPkgEnvs (addToPkgEnvs (addToPkgEnvs fm' (display $ sourcePackageId p) p) (display $ packageId p) p)
                                      (packageName p) p
 
       -- if no version number specified, pick the higher version
       addToPkgEnvs = addWithFM higherVersion
 
       higherVersion pkgconf1 pkgconf2
-        | installedPackageId pkgconf1 >= installedPackageId pkgconf2 = pkgconf1
+        | packageId pkgconf1 >= packageId pkgconf2 = pkgconf1
         | otherwise                                                  = pkgconf2
 
 --
@@ -350,7 +350,7 @@ union ls ps' =
 
 grabDefaultPkgConf :: IO PkgEnvs
 grabDefaultPkgConf = do
-        pc <- configureAllKnownPrograms silent defaultProgramConfiguration
+        pc <- configureAllKnownPrograms silent defaultProgramDb
 #if MIN_VERSION_Cabal(1,24,0)
         (compiler, _platform, _programConfiguration)
            <- configure silent Nothing Nothing pc
@@ -366,7 +366,7 @@ grabDefaultPkgConf = do
 --
 readPackageConf :: FilePath -> IO [PackageConfig]
 readPackageConf f = do
-    pc <- configureAllKnownPrograms silent defaultProgramConfiguration
+    pc <- configureAllKnownPrograms silent defaultProgramDb
 #if MIN_VERSION_Cabal(1,24,0)
     (compiler, _platform, _programConfiguration)
        <- configure silent Nothing Nothing pc
diff --git a/stack.yaml b/stack.yaml
index 1df60c7..f0aad65 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,7 +1,7 @@
 # For more information, see: https://github.com/commercialhaskell/stack/blob/master/doc/yaml_configuration.md
 
 # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
-resolver: lts-8.0
+resolver: lts-14.27
 
 # Local packages, usually specified by relative directory name
 packages:
diff --git a/stack.yaml.lock b/stack.yaml.lock
new file mode 100644
index 0000000..e24dcac
--- /dev/null
+++ b/stack.yaml.lock
@@ -0,0 +1,12 @@
+# This file was autogenerated by Stack.
+# You should not edit this file by hand.
+# For more information, please see the documentation at:
+#   https://docs.haskellstack.org/en/stable/lock_files
+
+packages: []
+snapshots:
+- completed:
+    size: 524996
+    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/27.yaml
+    sha256: 7ea31a280c56bf36ff591a7397cc384d0dff622e7f9e4225b47d8980f019a0f0
+  original: lts-14.27