diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -40,8 +40,11 @@
       let pack' = pack{depends=foldr (uncurry replace) (depends pack) table}
       writeFile infoPath $ showInstalledPackageInfo pack'
 
+init' :: [a] -> [a]
+init' = reverse . drop 1 . reverse
+
 getPackageName :: String -> String
-getPackageName pid = intercalate "-" $ take 2 $ splitOn "-" pid
+getPackageName pid = intercalate "-" $ init' $ splitOn "-" pid
 
 getPackageID :: String -> IO (Maybe String)
 getPackageID pName = do
diff --git a/ghc-pkg-autofix.cabal b/ghc-pkg-autofix.cabal
--- a/ghc-pkg-autofix.cabal
+++ b/ghc-pkg-autofix.cabal
@@ -7,7 +7,7 @@
 -- The package version. See the Haskell package versioning policy
 -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
 -- standards guiding when and how versions should be incremented.
-Version:             0.1.2
+Version:             0.1.3
 
 -- A short (one-line) description of the package.
 Synopsis:            Simple utility to fix BROKEN package dependencies.
