diff --git a/happstack-server.cabal b/happstack-server.cabal
--- a/happstack-server.cabal
+++ b/happstack-server.cabal
@@ -1,5 +1,5 @@
 Name:                happstack-server
-Version:             6.4.5
+Version:             6.4.6
 Synopsis:            Web related tools and services.
 Description:         Happstack Server provides an HTTP server and a rich set of functions for routing requests, handling query parameters, generating responses, working with cookies, serving files, and more. For in-depth documentation see the Happstack Crash Course <http://happstack.com/docs/crashcourse/index.html>
 License:             BSD3
diff --git a/src/Happstack/Server/Internal/Handler.hs b/src/Happstack/Server/Internal/Handler.hs
--- a/src/Happstack/Server/Internal/Handler.hs
+++ b/src/Happstack/Server/Internal/Handler.hs
@@ -344,7 +344,7 @@
 
 -- Response code names
 
-responseMessage :: (Num t) => t -> B.ByteString
+responseMessage :: (Num t, Show t, Eq t) => t -> B.ByteString
 responseMessage 100 = P.pack " 100 Continue\r\n"
 responseMessage 101 = P.pack " 101 Switching Protocols\r\n"
 responseMessage 200 = P.pack " 200 OK\r\n"
diff --git a/src/Happstack/Server/Internal/Monads.hs b/src/Happstack/Server/Internal/Monads.hs
--- a/src/Happstack/Server/Internal/Monads.hs
+++ b/src/Happstack/Server/Internal/Monads.hs
@@ -68,7 +68,7 @@
     restoreT = ServerPartT . restoreT . restoreT . liftM unStSP
 
 instance MonadBaseControl b m => MonadBaseControl b (ServerPartT m) where
-    newtype StM (ServerPartT m) b = StMSP {unStMSP :: ComposeSt ServerPartT m b}
+    newtype StM (ServerPartT m) a = StMSP {unStMSP :: ComposeSt ServerPartT m a}
     liftBaseWith = defaultLiftBaseWith StMSP
     restoreM     = defaultRestoreM     unStMSP
 
@@ -263,7 +263,7 @@
     restoreT = FilterT . restoreT . liftM unStFilter
 
 instance MonadBaseControl b m => MonadBaseControl b (FilterT a m) where
-    newtype StM (FilterT a m) b = StMFilter {unStMFilter :: ComposeSt (FilterT a) m b}
+    newtype StM (FilterT a m) c = StMFilter {unStMFilter :: ComposeSt (FilterT a) m c}
     liftBaseWith = defaultLiftBaseWith StMFilter
     restoreM     = defaultRestoreM     unStMFilter
 
@@ -323,7 +323,7 @@
     restoreT = WebT . restoreT . restoreT . restoreT . liftM unStWeb
 
 instance MonadBaseControl b m => MonadBaseControl b (WebT m) where
-    newtype StM (WebT m) b = StMWeb {unStMWeb :: ComposeSt WebT m b}
+    newtype StM (WebT m) a = StMWeb {unStMWeb :: ComposeSt WebT m a}
     liftBaseWith = defaultLiftBaseWith StMWeb
     restoreM     = defaultRestoreM     unStMWeb
 
diff --git a/src/Happstack/Server/Internal/Types.hs b/src/Happstack/Server/Internal/Types.hs
--- a/src/Happstack/Server/Internal/Types.hs
+++ b/src/Happstack/Server/Internal/Types.hs
@@ -399,7 +399,7 @@
 keepaliveC :: ByteString
 keepaliveC  = P.pack "Keep-Alive"
 
-readDec' :: (Num a) => String -> a
+readDec' :: (Num a, Eq a) => String -> a
 readDec' s =
   case readDec s of
     [(n,[])] -> n
