diff --git a/Network/WebSockets.hs b/Network/WebSockets.hs
--- a/Network/WebSockets.hs
+++ b/Network/WebSockets.hs
@@ -199,8 +199,8 @@
 {- Divides the number hiding in the string by the number of spaces in the string, as defined in the protocol. Assumes division by zero will not occur, since the request was verified to be valid beforehand. -}
 divNumBySpaces :: String -> Int32
 divNumBySpaces str =
-  let number = read $ filter isDigit str :: Int
-      spaces = length $ filter (==' ') str
+  let number = read $ filter isDigit str :: Integer
+      spaces = fromIntegral . length $ filter (==' ') str
   in  fromIntegral $ number `div` spaces
 
 
diff --git a/websockets.cabal b/websockets.cabal
--- a/websockets.cabal
+++ b/websockets.cabal
@@ -1,5 +1,5 @@
 Name:           websockets
-Version:        0.1.1.3
+Version:        0.1.1.5
 
 Cabal-version:  >=1.6
 
