diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+Changes from 0.8.5 to 0.8.6
+
+* Fixed arithmetic underflow during GHC >=8.8 build.
+* Added support GHC 9.0.
+
 Changes from 0.8.4 to 0.8.5
 ---------------------------
 
diff --git a/Data/Map/Static/Builder.hs b/Data/Map/Static/Builder.hs
--- a/Data/Map/Static/Builder.hs
+++ b/Data/Map/Static/Builder.hs
@@ -37,6 +37,6 @@
 findSplitSize :: Int -> Int
 findSplitSize len = let depth = treeDepth len
                         free = (maxSize depth) - len
-                    in if free <= (1 `shiftL` (depth - 2))
+                    in if 2 * free <= (1 `shiftL` (depth - 1))
                        then maxSize (depth - 1)
                        else len - (maxSize (depth - 2)) - 1
diff --git a/encoding.cabal b/encoding.cabal
--- a/encoding.cabal
+++ b/encoding.cabal
@@ -1,5 +1,5 @@
 Name:		encoding
-Version:	0.8.5
+Version:	0.8.6
 Author:		Henning Günther
 Maintainer:	daniel@wagner-home.com
 License:	BSD3
@@ -9,7 +9,7 @@
   Haskell has excellect handling of unicode, the Char type covers all unicode chars. Unfortunately, there's no possibility to read or write something to the outer world in an encoding other than ascii due to the lack of support for encodings. This library should help with that.
 Category:	Codec
 Homepage:	http://code.haskell.org/encoding/
-Cabal-Version:	>=1.10
+Cabal-Version:	2.0
 Build-Type:	Custom
 Extra-Source-Files:
   CHANGELOG
@@ -43,18 +43,18 @@
                  containers,
                  filepath,
                  ghc-prim,
-                 HaXml >=1.22 && <1.26
+                 HaXml >=1.22 && <1.27
 
 Library
   Build-Depends: array >=0.4 && <0.6,
                  base >=4 && <5,
                  binary >=0.7 && <0.10,
                  bytestring >=0.9 && <0.11,
-                 containers >=0.4 && <0.6,
+                 containers >=0.4 && <0.7,
                  extensible-exceptions >=0.1 && <0.2,
-                 ghc-prim >=0.3 && <0.6,
+                 ghc-prim >=0.3 && <0.8,
                  mtl >=2.0 && <2.3,
-                 regex-compat >=0.71 && <0.95
+                 regex-compat >=0.71 && <0.96
 
   Default-Language: Haskell2010
 
