diff --git a/Config.hs b/Config.hs
--- a/Config.hs
+++ b/Config.hs
@@ -2,9 +2,8 @@
 
 module Config (Option(..), parseOption, defaultOption) where
 
-import Control.Applicative ((<$>),(<$),(<*),(<*>),(*>))
 import Data.List (isPrefixOf)
-import Text.ParserCombinators.Parsec
+import Parsec
 
 ----------------------------------------------------------------
 
diff --git a/File.hs b/File.hs
--- a/File.hs
+++ b/File.hs
@@ -22,7 +22,7 @@
 progName = "Mighttpd"
 
 progVersion :: String
-progVersion = "0.4.1"
+progVersion = "0.4.2"
 
 progNameVersion :: String
 progNameVersion = progName ++ "/" ++ progVersion
@@ -49,7 +49,7 @@
 
 toPath :: ConvInfo -> FilePath -> Path
 toPath (CIFile dir)   restPath  = File $ dir </> restPath
-toPath ci@(CICgi _ _) progParam = PathCGI $ CGI {
+toPath ci@(CICgi _ _) progParam = PathCGI CGI {
     progPath    = prog
     , scriptName  = scriptname
     , pathInfo    = path
diff --git a/LogMsg.hs b/LogMsg.hs
--- a/LogMsg.hs
+++ b/LogMsg.hs
@@ -3,8 +3,9 @@
                errorMsg, warnMsg, noticeMsg,
                infoMsg, debugMsg) where
 
-import System.Log.Logger
+import Data.Maybe
 import System.Log.Handler.Syslog
+import System.Log.Logger
 
 errorMsg :: String -> IO ()
 errorMsg = errorM rootLoggerName
@@ -42,12 +43,12 @@
     updateGlobalLogger rootLoggerName (setLevel level)
 
 toLevel :: String -> Priority
-toLevel str = maybe (error ("Unknown level " ++ show str))
-                     id (lookup str levelDB)
+toLevel str = fromMaybe (error ("Unknown level " ++ show str))
+                        (lookup str levelDB)
 
 toFacility :: String -> Facility
-toFacility str = maybe (error ("Unknown facility " ++ show str))
-                        id (lookup str facilityDB)
+toFacility str = fromMaybe (error ("Unknown facility " ++ show str))
+                           (lookup str facilityDB)
 
 levelDB :: [(String, Priority)]
 levelDB = [
diff --git a/Mighttpd.hs b/Mighttpd.hs
--- a/Mighttpd.hs
+++ b/Mighttpd.hs
@@ -11,7 +11,7 @@
 import Network.Web.Server
 import System.Environment
 import System.Exit
-import System.Posix.Daemonize
+import System.Posix.Daemonize (daemonize)
 import URLMap
 
 ----------------------------------------------------------------
@@ -65,7 +65,7 @@
 
 makeInitHook :: Option -> IO ()
 makeInitHook opt =
-  if opt_debug_mode opt == True
+  if opt_debug_mode opt
   then initLog progName "" (opt_log_level opt) StdErr
   else initLog progName (opt_syslog_facility opt) (opt_log_level opt) SysLog
 
@@ -77,8 +77,6 @@
 
 makeStartedHook :: Option -> IO ()
 makeStartedHook opt =
-  if opt_debug_mode opt == True
-  then do
-    initLog progName "" (opt_log_level opt) StdErr
-  else do
-    initLog progName (opt_syslog_facility opt) (opt_log_level opt) SysLog
+  if opt_debug_mode opt
+  then initLog progName "" (opt_log_level opt) StdErr
+  else initLog progName (opt_syslog_facility opt) (opt_log_level opt) SysLog
diff --git a/Parsec.hs b/Parsec.hs
new file mode 100644
--- /dev/null
+++ b/Parsec.hs
@@ -0,0 +1,52 @@
+{-# LANGUAGE CPP #-}
+
+#ifndef MIN_VERSION_parsec
+#define MIN_VERSION_parsec(x,y,z) 0
+#endif
+
+#if MIN_VERSION_parsec(3,0,0)
+module Parsec (
+      module Control.Applicative
+    , module Text.Parsec
+    , module Text.Parsec.String
+    ) where
+
+import Control.Applicative hiding (many,optional,(<|>))
+import Text.Parsec
+import Text.Parsec.String
+#else
+module Parsec (
+      module Text.ParserCombinators.Parsec
+    , (<$>), (<$), (<*>), (<*), (*>), pure
+    ) where
+
+import Control.Monad (ap, liftM)
+import Text.ParserCombinators.Parsec
+
+{-
+  GenParser cannot be an instance of Applicative and Alternative
+  due to the overlapping instances error, sigh!
+-}
+
+(<$>) :: Monad m => (a -> b) -> m a -> m b
+(<$>) = liftM
+
+(<$) :: Monad m => a -> m b -> m a
+a <$ m = m >> return a
+
+(<*>) :: Monad m => m (a -> b) -> m a -> m b
+(<*>) = ap
+
+(*>) :: Monad m => m a -> m b -> m b
+(*>) = (>>)
+
+(<*) :: Monad m => m a -> m b -> m a
+m1 <* m2 = do x <- m1
+              m2
+              return x
+
+pure :: Monad m => a -> m a
+pure = return
+
+infixl 4 <$>, <$, <*>, <*, *>
+#endif
diff --git a/URLMap.hs b/URLMap.hs
--- a/URLMap.hs
+++ b/URLMap.hs
@@ -2,11 +2,9 @@
 
 module URLMap (parseURLMap, URL, URLMap, ConvInfo(..)) where
 
-import Control.Applicative ((<$>),(<$),(<*),(<*>),(*>),pure)
 import qualified Data.ByteString.Char8 as S
 import Network.Web.URI
-import Text.Parsec
-import Text.Parsec.String
+import Parsec
 
 type URL = String
 data ConvInfo = CIFile String | CICgi { progDir :: String
diff --git a/mighttpd.cabal b/mighttpd.cabal
--- a/mighttpd.cabal
+++ b/mighttpd.cabal
@@ -1,5 +1,5 @@
 Name:                   mighttpd
-Version:                0.4.1
+Version:                0.4.2
 Author:                 Kazu Yamamoto <kazu@iij.ad.jp>
 Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp>
 License:                BSD3
@@ -11,7 +11,7 @@
 Category:               Network
 Cabal-Version:          >= 1.6
 Build-Type:             Simple
-Extra-Source-Files:     Config.hs LogMsg.hs Setup.hs File.hs URLMap.hs
+Extra-Source-Files:     Config.hs LogMsg.hs Setup.hs File.hs URLMap.hs Parsec.hs
 Data-Files:             sample.conf sample.map
 Executable mighttpd
   Main-Is:              Mighttpd.hs
@@ -20,7 +20,7 @@
   else
     GHC-Options:        -Wall -O2
   Ghc-Prof-Options:     -prof -auto-all -caf-all
-  Build-Depends:        base >= 4 && < 5, parsec >= 3,
+  Build-Depends:        base >= 4 && < 5, parsec,
                         c10k, hslogger, webserver, bytestring, filepath,
                         haskell98, hdaemonize, directory, unix, time, network
 Executable mkindex
diff --git a/mkindex.hs b/mkindex.hs
--- a/mkindex.hs
+++ b/mkindex.hs
@@ -56,7 +56,7 @@
   | isDirectory st = "  - "
   | otherwise      = sizeFormat . fromIntegral . fileSize $ st
   where
-    sizeFormat siz = unit siz [' ','K','M','G','T']
+    sizeFormat siz = unit siz " KMGT"
     unit _ []  = undefined
     unit s [u] = format s u
     unit s (u:us)
