diff --git a/bencoding.cabal b/bencoding.cabal
--- a/bencoding.cabal
+++ b/bencoding.cabal
@@ -1,5 +1,5 @@
 name:                  bencoding
-version:               0.4.5.2
+version:               0.4.5.3
 license:               BSD3
 license-file:          LICENSE
 author:                Sam Truzjan
@@ -67,7 +67,7 @@
                      , pretty
   ghc-options:         -Wall -O2
   if !impl(ghc >= 8.0.0)
-    build-depends:     semigroups >= 0.9 && < 0.19
+    build-depends:     semigroups >= 0.9
 
   if flag(dev)
     ghc-options:
diff --git a/src/Data/BEncode/BDict.hs b/src/Data/BEncode/BDict.hs
--- a/src/Data/BEncode/BDict.hs
+++ b/src/Data/BEncode/BDict.hs
@@ -131,7 +131,7 @@
 union :: BDictMap a -> BDictMap a -> BDictMap a
 union Nil xs  = xs
 union xs  Nil = xs
-union bd @ (Cons k v xs) bd' @ (Cons k' v' xs')
+union bd@(Cons k v xs) bd'@(Cons k' v' xs')
   |   k < k'  = Cons k  v  (union xs bd')
   | otherwise = Cons k' v' (union bd xs')
 
diff --git a/src/Data/BEncode/Internal.hs b/src/Data/BEncode/Internal.hs
--- a/src/Data/BEncode/Internal.hs
+++ b/src/Data/BEncode/Internal.hs
@@ -27,9 +27,14 @@
 import           Data.ByteString as B
 import           Data.ByteString.Internal as B (c2w, w2c)
 import qualified Data.ByteString.Lazy as Lazy
-import qualified Data.ByteString.Lazy.Builder as B
 import Data.List as L
 import Text.PrettyPrint hiding ((<>))
+
+#if MIN_VERSION_bytestring(0, 10, 12)
+import qualified Data.ByteString.Builder as B
+#else
+import qualified Data.ByteString.Lazy.Builder as B
+#endif
 
 #if __GLASGOW_HASKELL__ < 710
 import Data.Foldable
