diff --git a/Data/BloomFilter.hs b/Data/BloomFilter.hs
--- a/Data/BloomFilter.hs
+++ b/Data/BloomFilter.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, Rank2Types, TypeOperators #-}
+{-# LANGUAGE BangPatterns, CPP, Rank2Types, TypeOperators #-}
 {-# OPTIONS_GHC -fglasgow-exts #-}
 
 -- |
@@ -87,6 +87,8 @@
     , bitArrayMB
     ) where
 
+#include "MachDeps.h"
+
 import Control.Monad (liftM, forM_)
 import Control.Monad.ST (ST, runST)
 import Control.Parallel.Strategies (NFData(..))
@@ -164,7 +166,11 @@
         isPowerOfTwo n = n .&. (n - 1) == 0
 
 maxHash :: Int
-maxHash = 4294967296 -- fromIntegral (maxBound :: Hash)
+#if WORD_SIZE_IN_BITS == 64
+maxHash = 4294967296
+#else
+maxHash = 2147483648
+#endif
 
 logBitsInHash :: Int
 logBitsInHash = 5 -- logPower2 bitsInHash
diff --git a/Data/BloomFilter/Hash.hs b/Data/BloomFilter/Hash.hs
--- a/Data/BloomFilter/Hash.hs
+++ b/Data/BloomFilter/Hash.hs
@@ -143,11 +143,12 @@
 {-# SPECIALIZE cheapHashes :: Int -> String -> [Word32] #-}
 cheapHashes k v = go 0
     where go i | i == j = []
-               | otherwise = h1 + (h2 `shiftR` i) : go (i + 1)
-          !h1 = fromIntegral (h `shiftR` 32) .&. maxBound
-          !h2 = fromIntegral h
+               | otherwise = hash : go (i + 1)
+               where !hash = h1 + (h2 `shiftR` i)
+          h1 = fromIntegral (h `shiftR` 32)
+          h2 = fromIntegral h
           h = hashSalt64 0x9150a946c4a8966e v
-          j = fromIntegral k - 1
+          j = fromIntegral k
 
 instance Hashable () where
     hashIO32 _ salt = return salt
diff --git a/bloomfilter.cabal b/bloomfilter.cabal
--- a/bloomfilter.cabal
+++ b/bloomfilter.cabal
@@ -1,5 +1,5 @@
 name:            bloomfilter
-version:         1.2.6.3
+version:         1.2.6.4
 license:         BSD3
 license-file:    LICENSE
 author:          Bryan O'Sullivan <bos@serpentine.com>
