diff --git a/graphmod.cabal b/graphmod.cabal
--- a/graphmod.cabal
+++ b/graphmod.cabal
@@ -1,5 +1,5 @@
 name:           graphmod
-version:        1.3
+version:        1.4
 license:        BSD3
 license-file:   LICENSE
 author:         Iavor S. Diatchki
diff --git a/src/Utils.hs b/src/Utils.hs
--- a/src/Utils.hs
+++ b/src/Utils.hs
@@ -16,6 +16,7 @@
 import Language.Haskell.Lexer(lexerPass0,Token(..),PosToken,line)
 
 import Control.Monad(mplus)
+import Control.Exception(evaluate)
 import Data.Maybe(catMaybes)
 import Data.List(intersperse,isPrefixOf)
 import System.Directory(doesFileExist)
@@ -31,6 +32,7 @@
 parseFile          :: FilePath -> IO (ModName,[Import])
 parseFile f =
   do (modName, imps) <- (parseString . get_text) `fmap` readFile f
+     evaluate (length imps) -- this is here so that the file gets closed
      if ext == ".imports"
        then return (splitModName (takeBaseName f), imps)
        else return (modName, imps)
