diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs
--- a/Data/FileEmbed.hs
+++ b/Data/FileEmbed.hs
@@ -58,7 +58,7 @@
 -- > myDir :: [(FilePath, Data.ByteString.ByteString)]
 -- > myDir = $(embedDir "dirName")
 embedDir :: FilePath -> Q Exp
-embedDir fp = ListE <$> ((runIO $ fileList fp) >>= mapM pairToExp)
+embedDir fp = ListE <$> ((runIO $ fileList fp) >>= mapM (pairToExp fp))
 
 -- | Get a directory tree in the IO monad.
 --
@@ -66,10 +66,10 @@
 getDir :: FilePath -> IO [(FilePath, B.ByteString)]
 getDir = fileList
 
-pairToExp :: (FilePath, B.ByteString) -> Q Exp
-pairToExp (path, bs) = do
+pairToExp :: FilePath -> (FilePath, B.ByteString) -> Q Exp
+pairToExp root (path, bs) = do
 #if MIN_VERSION_template_haskell(2,7,0)
-    qAddDependentFile path
+    qAddDependentFile $ root ++ '/' : path
 #endif
     exp' <- bsToExp bs
     return $! TupE [LitE $ StringL path, exp']
diff --git a/file-embed.cabal b/file-embed.cabal
--- a/file-embed.cabal
+++ b/file-embed.cabal
@@ -1,15 +1,16 @@
 name:            file-embed
-version:         0.0.4.2
+version:         0.0.4.3
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
 maintainer:      Michael Snoyman <michael@snoyman.com>
 synopsis:        Use Template Haskell to embed file contents directly.
 category:        Data
-stability:       unstable
-cabal-version:   >= 1.2
+stability:       Stable
+cabal-version:   >= 1.8
 build-type:      Simple
-homepage:        http://github.com/snoyberg/file-embed/tree/master
+homepage:        https://github.com/snoyberg/file-embed
+extra-source-files: test/main.hs, test/sample/foo
 
 library
     build-depends:   base >= 4 && < 5,
@@ -18,3 +19,14 @@
                      template-haskell
     exposed-modules: Data.FileEmbed
     ghc-options:     -Wall
+
+test-suite test
+    type: exitcode-stdio-1.0
+    main-is: main.hs
+    hs-source-dirs: test
+    build-depends: base
+                 , file-embed
+
+source-repository head
+  type:     git
+  location: https://github.com/snoyberg/file-embed
diff --git a/test/main.hs b/test/main.hs
new file mode 100644
--- /dev/null
+++ b/test/main.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+import Data.FileEmbed
+
+main :: IO ()
+main = print $(embedDir "test/sample")
diff --git a/test/sample/foo b/test/sample/foo
new file mode 100644
--- /dev/null
+++ b/test/sample/foo
@@ -0,0 +1,1 @@
+foo
