diff --git a/Text/Shakespeare.hs b/Text/Shakespeare.hs
--- a/Text/Shakespeare.hs
+++ b/Text/Shakespeare.hs
@@ -25,6 +25,7 @@
 
 import Text.ParserCombinators.Parsec hiding (Line)
 import Language.Haskell.TH.Quote (QuasiQuoter (..))
+import Language.Haskell.TH (appE)
 import Language.Haskell.TH.Syntax
 #if !MIN_VERSION_template_haskell(2,8,0)
 import Language.Haskell.TH.Syntax.Internals
@@ -86,6 +87,10 @@
     , unwrap :: Exp
     , justVarInterpolation :: Bool
     , preConversion :: Maybe PreConvert
+    , modifyFinalValue :: Maybe Exp
+    -- ^ A transformation applied to the final expression. Most often, this
+    -- would be used to force the type of the expression to help make more
+    -- meaningful error messages.
     }
 
 defaultShakespeareSettings :: ShakespeareSettings
@@ -95,6 +100,7 @@
   , intChar = '^'
   , justVarInterpolation = False
   , preConversion = Nothing
+  , modifyFinalValue = Nothing
 }
 
 instance Lift PreConvert where
@@ -107,14 +113,16 @@
     lift Id = [|Id|]
 
 instance Lift ShakespeareSettings where
-    lift (ShakespeareSettings x1 x2 x3 x4 x5 x6 x7 x8) =
+    lift (ShakespeareSettings x1 x2 x3 x4 x5 x6 x7 x8 x9) =
         [|ShakespeareSettings
             $(lift x1) $(lift x2) $(lift x3)
-            $(liftExp x4) $(liftExp x5) $(liftExp x6) $(lift x7) $(lift x8)|]
+            $(liftExp x4) $(liftExp x5) $(liftExp x6) $(lift x7) $(lift x8) $(liftMExp x9)|]
       where
         liftExp (VarE n) = [|VarE $(liftName n)|]
         liftExp (ConE n) = [|ConE $(liftName n)|]
         liftExp _ = error "liftExp only supports VarE and ConE"
+        liftMExp Nothing = [|Nothing|]
+        liftMExp (Just e) = [|Just|] `appE` liftExp e
         liftName (Name (OccName a) b) = [|Name (OccName $(lift a)) $(liftFlavour b)|]
         liftFlavour NameS = [|NameS|]
         liftFlavour (NameQ (ModName a)) = [|NameQ (ModName $(lift a))|]
@@ -222,14 +230,17 @@
     r <- newName "_render"
     c <- mapM (contentToBuilder r) a
     compiledTemplate <- case c of
-        []  -> [|mempty|]
+        -- Make sure we convert this mempty using toBuilder to pin down the
+        -- type appropriately
+        []  -> fmap (AppE $ wrap rs) [|mempty|]
         [x] -> return x
         _   -> do
               mc <- [|mconcat|]
               return $ mc `AppE` ListE c
-    if justVarInterpolation rs
-      then return compiledTemplate
-      else return $ LamE [VarP r] compiledTemplate
+    fmap (maybe id AppE $ modifyFinalValue rs) $
+        if justVarInterpolation rs
+            then return compiledTemplate
+            else return $ LamE [VarP r] compiledTemplate
       where
         contentToBuilder :: Name -> Content -> Q Exp
         contentToBuilder _ (ContentRaw s') = do
diff --git a/shakespeare.cabal b/shakespeare.cabal
--- a/shakespeare.cabal
+++ b/shakespeare.cabal
@@ -1,5 +1,5 @@
 name:            shakespeare
-version:         1.0.1.3
+version:         1.0.1.4
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -51,8 +51,7 @@
     build-depends: shakespeare
                  , base             >= 4       && < 5
                  , parsec           >= 2       && < 4
-                 , HUnit
-                 , hspec            >= 0.8     && < 1.3
+                 , hspec            >= 1.3
                  , text             >= 0.7     && < 0.12
 
 
diff --git a/test/ShakespeareBaseTest.hs b/test/ShakespeareBaseTest.hs
--- a/test/ShakespeareBaseTest.hs
+++ b/test/ShakespeareBaseTest.hs
@@ -1,8 +1,6 @@
 module ShakespeareBaseTest (specs) where
 
-import Test.HUnit hiding (Test)
-import Test.Hspec.Monadic
-import Test.Hspec.HUnit ()
+import Test.Hspec
 
 import Text.ParserCombinators.Parsec (parse, ParseError, (<|>))
 import Text.Shakespeare.Base (parseVarString, parseUrlString, parseIntString)
@@ -10,29 +8,30 @@
 
 -- run :: Text.Parsec.Prim.Parsec Text.Parsec.Pos.SourceName () c -> Text.Parsec.Pos.SourceName -> c
 
-specs :: Specs
+specs :: Spec
 specs = describe "shakespeare-js" $ do
   it "parseStrings" $ do
-    Right "%{var}" @=?  run varString "%{var}"
-    Right "@{url}" @=?  run urlString "@{url}"
-    Right "^{int}" @=?  run intString "^{int}"
-    Right "@{url}" @=?  run (varString <|> urlString <|> intString) "@{url} #{var}"
+    run varString "%{var}" `shouldBe` Right "%{var}"
+    run urlString "@{url}" `shouldBe` Right "@{url}"
+    run intString "^{int}" `shouldBe` Right "^{int}"
 
+    run (varString <|> urlString <|> intString) "@{url} #{var}" `shouldBe` Right "@{url}"
+
   it "preFilter off" $ do
-    str <- preFilter defaultShakespeareSettings template
-    str @=? template
+    preFilter defaultShakespeareSettings template
+      `shouldReturn` template
 
   it "preFilter on" $ do
-    str <- preFilter preConversionSettings template
-    "unchanged `#{var}` `@{url}` `^{int}`" @=? str
+    preFilter preConversionSettings template
+      `shouldReturn` "unchanged `#{var}` `@{url}` `^{int}`"
 
   it "preFilter ignore quotes" $ do
-    str <- preFilter preConversionSettings templateQuote
-    "unchanged '#{var}' `@{url}` '^{int}'" @=? str
+    preFilter preConversionSettings templateQuote
+      `shouldReturn` "unchanged '#{var}' `@{url}` '^{int}'"
 
   it "preFilter ignore comments" $ do
-    str <- preFilter preConversionSettings templateCommented
-    "unchanged & '#{var}' @{url} '^{int}'" @=? str
+    preFilter preConversionSettings templateCommented
+      `shouldReturn` "unchanged & '#{var}' @{url} '^{int}'"
 
   where
     varString = parseVarString '%'
