diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,11 @@
 
 Version history.
 
-## 0.1.5 released 2021-03-16
+## 0.1.5.1 Andreas Abel 2021-08-22
+
+- fixed #3: correctly obtain GHC's libdir
+
+## 0.1.5 Andreas Abel 2021-03-16
 
 - initial release
 - tested with GHC 8.0.2 - 9.0.1
diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -1,6 +1,7 @@
-{-# LANGUAGE CPP                 #-}
-{-# LANGUAGE PatternSynonyms     #-}
-{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE CPP                      #-}
+{-# LANGUAGE NondecreasingIndentation #-}
+{-# LANGUAGE PatternSynonyms          #-}
+{-# LANGUAGE ScopedTypeVariables      #-}
 
 module Main where
 
@@ -22,6 +23,8 @@
 import System.Process
 import System.Console.GetOpt
 
+import qualified GHC.Paths as GHC
+
 import GHC
   ( DynFlags
   , HsModule
@@ -197,9 +200,15 @@
     extOpts = map extToOpt exts
     langOpts = langToOpt <$> maybeToList maybeLang
 
+usage :: IO ()
+usage = do
+    printUsage stdout
+    exitSuccess
+
 main :: IO ()
 main = do
   opts <- getOptions
+  if optHelp opts then usage else do
 
   let agdaReadPackageDescription =
 #if MIN_VERSION_Cabal(2,0,0)
@@ -209,12 +218,8 @@
 #endif
 
   pkgDesc <- T.mapM (agdaReadPackageDescription minBound) $ optCabalPath opts
-  let go | optHelp opts = do
-            printUsage stdout
-            exitSuccess
-         | otherwise = do
-            top : _ <- lines <$> runCmd "ghc --print-libdir"
-            ts <- runGhc (Just top) $ do
+  do
+            ts <- runGhc (Just GHC.libdir) $ do
               dynFlags <- getSessionDynFlags
               let dynFlags' =
                     dynFlags {
@@ -247,7 +252,6 @@
               writeFile (optCTagsFile opts) $ unlines $ map show sts
             when (optETags opts) $
               writeFile (optETagsFile opts) $ showETags ts
-  go
 
 getOptions :: IO Options
 getOptions = do
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,3 +1,9 @@
+[![Hackage version](https://img.shields.io/hackage/v/hs-tags.svg?label=Hackage&color=informational)](http://hackage.haskell.org/package/hs-tags)
+[![Hackage CI](https://matrix.hackage.haskell.org/api/v2/packages/hs-tags/badge)](https://matrix.hackage.haskell.org/package/hs-tags)
+[![hs-tags on Stackage Nightly](https://stackage.org/package/hs-tags/badge/nightly)](https://stackage.org/nightly/package/hs-tags)
+[![Stackage LTS version](https://www.stackage.org/package/hs-tags/badge/lts?label=Stackage)](https://www.stackage.org/package/hs-tags)
+[![Cabal build](https://github.com/agda/hs-tags/workflows/Haskell-CI/badge.svg)](https://github.com/agda/hs-tags/actions)
+
 hs-tags - Generate tags for Haskell code
 ========================================
 
diff --git a/hs-tags.cabal b/hs-tags.cabal
--- a/hs-tags.cabal
+++ b/hs-tags.cabal
@@ -1,5 +1,5 @@
 name:            hs-tags
-version:         0.1.5
+version:         0.1.5.1
 cabal-version:   >= 1.10
 build-type:      Simple
 license:         MIT
@@ -12,8 +12,8 @@
 synopsis:        Create tag files (ctags and etags) for Haskell code.
 description:     .
   Executable to generate a tags (ctags) or TAGS (etags) file
-  for a bunch of Haskell files.
-  These files are used by editors (e.g. TAGS by Emacs) to
+  for a bunch of Haskell files, using GHC as parser.
+  These tag files are used by editors (e.g. TAGS by Emacs) to
   implement jump-to-definition (e.g. M-. in Emacs).
 
 tested-with:
@@ -36,7 +36,7 @@
 source-repository this
   type:     git
   location: https://github.com/agda/hs-tags.git
-  tag:      v0.1.5
+  tag:      v0.1.5.1
 
 executable hs-tags
   main-is:          Main.hs
@@ -47,11 +47,12 @@
 
   build-depends:
       base        >= 4.9.0.0   &&  < 4.16
-    , Cabal       >= 1.24.0.0  &&  < 3.5
+    , Cabal       >= 1.24.0.0  &&  < 3.7
     , containers  >= 0.5.7.1   &&  < 0.7
     , directory   >= 1.2.6.2   &&  < 1.4
     , filepath    >= 1.4.1.0   &&  < 1.5
     , ghc         >= 8.0.2     &&  < 9.1
+    , ghc-paths   >= 0.1.0.12  &&  < 0.2
     , mtl         >= 2.2.1     &&  < 2.3
     , process     >= 1.4.2.0   &&  < 1.7
     , strict      >= 0.3.2     &&  < 0.5
