diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,9 @@
 
+# Version 0.17.2.0 (2025-09-08)
+
+- Fix the package failing to build on GHC 9.6.1 through 9.6.6 and
+  on GHC 9.8.1 through 9.8.3. GHC versions 9.6.7 and 9.8.4 are unaffected.
+
 # Version 0.17.1.0 (2025-08-27)
 
 - Fix a regression, introduced in `0.17.0.0`, in which `splitTyConApp_upTo` would
diff --git a/ghc-tcplugin-api.cabal b/ghc-tcplugin-api.cabal
--- a/ghc-tcplugin-api.cabal
+++ b/ghc-tcplugin-api.cabal
@@ -1,6 +1,6 @@
 cabal-version:  3.0
 name:           ghc-tcplugin-api
-version:        0.17.1.0
+version:        0.17.2.0
 synopsis:       An API for type-checker plugins.
 license:        BSD-3-Clause
 build-type:     Simple
diff --git a/src/GHC/TcPlugin/API/TyConSubst.hs b/src/GHC/TcPlugin/API/TyConSubst.hs
--- a/src/GHC/TcPlugin/API/TyConSubst.hs
+++ b/src/GHC/TcPlugin/API/TyConSubst.hs
@@ -41,6 +41,18 @@
   , splitTyConApp_upTo
   ) where
 
+-- Word64Map is available:
+--
+--  - from 9.10.1 onwards
+--  - in 9.8.4
+--  - in 9.6.7
+--
+-- This is unusual: whether a module is exposed depends on the MINOR version
+#define HAS_WORD64MAP \
+    (MIN_VERSION_ghc(9,9,0) || \
+    (MIN_VERSION_ghc(9,8,4) && !(MIN_VERSION_ghc(9,9,0))) || \
+    (MIN_VERSION_ghc(9,6,7) && !(MIN_VERSION_ghc(9,7,0))))
+
 -- base
 import Data.Bifunctor
   ( Bifunctor(first, second) )
@@ -63,7 +75,7 @@
 import qualified Data.Sequence as Seq
 
 -- ghc
-#if MIN_VERSION_ghc(9,5,0)
+#if HAS_WORD64MAP
 import qualified GHC.Data.Word64Map.Strict as Word64Map
 #else
 import qualified Data.IntMap.Strict as IntMap
@@ -111,7 +123,7 @@
 --   derive any additional equalities from them (i.e. if, say, we know that
 --   @x ~ T1@ and @x ~ T2@, we will not attempt to use the fact that this means
 --   that @T1 ~ T2@, nor any derived conclusions thereof). We /will/ however
---   try to apply the canononical equalities as often as is necessary (e.g.,
+--   try to apply the canonical equalities as often as is necessary (e.g.,
 --   first applying @x ~ T y@, then applying @y ~ T2@).
 --
 -- We solve this problem by constructing a 'TyConSubst': a possibly
@@ -289,7 +301,7 @@
 -- o We keep doing this until we can make no more progress.
 --
 -- The functions for working with 'TyConSubst' take the variable equivalence
--- classes into acocunt, so we do not need to do that here.
+-- classes into account, so we do not need to do that here.
 --
 -- Two observations:
 --
@@ -498,7 +510,7 @@
           ( unsafeCoerce :: IntMap.IntMap a -> UniqFM a a )
 #endif
         ) <$>
-#if MIN_VERSION_ghc(9,5,0)
+#if HAS_WORD64MAP
       Word64Map.minView
 #else
       IntMap.minView
