diff --git a/cereal.cabal b/cereal.cabal
--- a/cereal.cabal
+++ b/cereal.cabal
@@ -1,5 +1,5 @@
 name:                   cereal
-version:                0.5.8.1
+version:                0.5.8.2
 license:                BSD3
 license-file:           LICENSE
 author:                 Lennart Kolmodin <kolmodin@dtek.chalmers.se>,
diff --git a/src/Data/Serialize.hs b/src/Data/Serialize.hs
--- a/src/Data/Serialize.hs
+++ b/src/Data/Serialize.hs
@@ -289,9 +289,9 @@
     let expMax = until (\e -> 2 ^ e > k) (* 2) 1
         findNr :: Int -> Int -> Int
         findNr lo hi
-            | mid == lo = hi
+            | mid == lo    = hi
             | 2 ^ mid <= k = findNr mid hi
-            | 2 ^ mid > k  = findNr lo mid
+            | otherwise    = findNr lo mid
          where mid = (lo + hi) `div` 2
     in findNr (expMax `div` 2) expMax
 
diff --git a/src/Data/Serialize/Get.hs b/src/Data/Serialize/Get.hs
--- a/src/Data/Serialize/Get.hs
+++ b/src/Data/Serialize/Get.hs
@@ -300,8 +300,8 @@
 {-# INLINE runGetPartial #-}
 
 -- | Run the Get monad applies a 'get'-based parser on the input
--- ByteString. Additional to the result of get it returns the number of
--- consumed bytes and the rest of the input.
+-- ByteString, starting at the specified offset. In addition to the result of get
+-- it returns the rest of the input.
 runGetState :: Get a -> B.ByteString -> Int
             -> Either String (a, B.ByteString)
 runGetState m str off = case runGetState' m str off of
@@ -310,8 +310,8 @@
 {-# INLINE runGetState #-}
 
 -- | Run the Get monad applies a 'get'-based parser on the input
--- ByteString. Additional to the result of get it returns the number of
--- consumed bytes and the rest of the input, even in the event of a failure.
+-- ByteString, starting at the specified offset. In addition to the result of get
+-- it returns the rest of the input, even in the event of a failure.
 runGetState' :: Get a -> B.ByteString -> Int
              -> (Either String a, B.ByteString)
 runGetState' m str off =
@@ -723,8 +723,13 @@
 shiftl_w64 :: Word64 -> Int -> Word64
 
 #if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
+#if MIN_VERSION_base(4,16,0)
+shiftl_w16 (W16# w) (I# i) = W16# (w `uncheckedShiftLWord16#` i)
+shiftl_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftLWord32#` i)
+#else
 shiftl_w16 (W16# w) (I# i) = W16# (w `uncheckedShiftL#`   i)
 shiftl_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftL#`   i)
+#endif
 
 #if WORD_SIZE_IN_BITS < 64
 shiftl_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftL64#` i)
