diff --git a/FileCache.hs b/FileCache.hs
--- a/FileCache.hs
+++ b/FileCache.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE BangPatterns #-}
+
 module FileCache (fileCacheInit) where
 
 import Control.Concurrent
@@ -14,10 +16,14 @@
 
 data Entry = Negative | Positive FileInfo
 type Cache = Map ByteString Entry
-type GetInfo = Path -> IO (Maybe FileInfo)
+type GetInfo = Path -> IO FileInfo
 
 fileInfo :: IORef Cache -> GetInfo
-fileInfo ref path = atomicModifyIORef ref (lok path)
+fileInfo ref path = do
+  !mx <- atomicModifyIORef ref (lok path)
+  case mx of
+      Nothing -> throwIO (userError "fileInfo")
+      Just x  -> return x
 
 lok :: Path -> Cache -> (Cache, Maybe FileInfo)
 lok path cache = unsafePerformIO $ do
diff --git a/Parser.hs b/Parser.hs
--- a/Parser.hs
+++ b/Parser.hs
@@ -1,6 +1,7 @@
 module Parser where
 
 import Control.Applicative hiding (many,(<|>))
+import Control.Exception
 import qualified Data.ByteString.Lazy.Char8 as BL
 import System.IO
 import Text.Parsec
@@ -33,4 +34,4 @@
     bs <- BL.hGetContents hdl
     case parse p "parseFile" bs of
         Right x -> return x
-        Left  e -> error . show $ e
+        Left  e -> throwIO . userError . show $ e
diff --git a/Types.hs b/Types.hs
--- a/Types.hs
+++ b/Types.hs
@@ -4,6 +4,8 @@
 
 import Data.ByteString
 import Data.ByteString.Char8 ()
+import Data.Version
+import Paths_mighttpd2
 
 type Src      = ByteString
 type Dst      = ByteString
@@ -21,7 +23,7 @@
 programName = "Mighttpd"
 
 programVersion :: String
-programVersion = "2.4.0"
+programVersion = showVersion version
 
 defaultDomain :: Domain
 defaultDomain = "localhost"
diff --git a/mighttpd2.cabal b/mighttpd2.cabal
--- a/mighttpd2.cabal
+++ b/mighttpd2.cabal
@@ -1,5 +1,5 @@
 Name:                   mighttpd2
-Version:                2.4.1
+Version:                2.4.2
 Author:                 Kazu Yamamoto <kazu@iij.ad.jp>
 Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp>
 License:                BSD3
@@ -31,6 +31,7 @@
                         Parser
                         Route
                         Types
+                        Paths_mighttpd2
 Executable mkindex
   Main-Is:              mkindex.hs
   GHC-Options:          -Wall -fno-warn-unused-do-bind
