diff --git a/Network/Wai/Handler/CGI.hs b/Network/Wai/Handler/CGI.hs
--- a/Network/Wai/Handler/CGI.hs
+++ b/Network/Wai/Handler/CGI.hs
@@ -147,16 +147,17 @@
             Just _ -> h
 
 cleanupVarName :: String -> CI.CI B.ByteString
-cleanupVarName ('H':'T':'T':'P':'_':a:as) =
-    String.fromString $ a : helper' as
+cleanupVarName "CONTENT_TYPE" = "Content-Type"
+cleanupVarName "CONTENT_LENGTH" = "Content-Length"
+cleanupVarName "SCRIPT_NAME" = "CGI-Script-Name"
+cleanupVarName s =
+    case s of
+        'H':'T':'T':'P':'_':a:as -> String.fromString $ a : helper' as
+        _ -> String.fromString s -- FIXME remove?
   where
     helper' ('_':x:rest) = '-' : x : helper' rest
     helper' (x:rest) = toLower x : helper' rest
     helper' [] = []
-cleanupVarName "CONTENT_TYPE" = "Content-Type"
-cleanupVarName "CONTENT_LENGTH" = "Content-Length"
-cleanupVarName "SCRIPT_NAME" = "CGI-Script-Name"
-cleanupVarName x = String.fromString x -- FIXME remove?
 
 requestBodyHandle :: Handle -> Int -> Enumerator B.ByteString IO a
 requestBodyHandle h =
diff --git a/Network/Wai/Middleware/Debug.hs b/Network/Wai/Middleware/Debug.hs
--- a/Network/Wai/Middleware/Debug.hs
+++ b/Network/Wai/Middleware/Debug.hs
@@ -45,7 +45,7 @@
   where
     paramsToStr prefix params = if null params then "" else "\n" ++ prefix ++ (show params)
 
-    allPostParams req body = run_ $ enumList 1 body $$ parseRequestBody lbsSink req
+    allPostParams req' body = run_ $ enumList 1 body $$ parseRequestBody lbsSink req'
 
     emptyGetParam :: (S.ByteString, Maybe S.ByteString) -> (S.ByteString, S.ByteString)
     emptyGetParam (k, Just v) = (k,v)
diff --git a/wai-extra.cabal b/wai-extra.cabal
--- a/wai-extra.cabal
+++ b/wai-extra.cabal
@@ -1,5 +1,5 @@
 Name:                wai-extra
-Version:             0.4.1.2
+Version:             0.4.2
 Synopsis:            Provides some basic WAI handlers and middleware.
 Description:         The goal here is to provide common features without many dependencies.
 License:             BSD3
@@ -51,8 +51,7 @@
     build-depends:   base                      >= 4        && < 5
                    , wai-extra
                    , wai-test
-                   , test-framework
-                   , test-framework-hunit
+                   , hspec >= 0.6.1 && < 0.7
                    , HUnit
 
                    , wai
