diff --git a/Setup.hs b/Setup.hs
deleted file mode 100644
--- a/Setup.hs
+++ /dev/null
@@ -1,2 +0,0 @@
-import Distribution.Simple
-main = defaultMain
diff --git a/Setup.lhs b/Setup.lhs
new file mode 100644
--- /dev/null
+++ b/Setup.lhs
@@ -0,0 +1,11 @@
+#!/usr/bin/env runhaskell
+
+> module Main where
+> import Distribution.Simple
+> import System.Cmd (system)
+
+> main :: IO ()
+> main = defaultMainWithHooks (simpleUserHooks { runTests = runTests' })
+
+> runTests' :: a -> b -> c -> d -> IO ()
+> runTests' _ _ _ _ = system "runhaskell -DTEST runtests.hs" >> return ()
diff --git a/Text/Hamlet.hs b/Text/Hamlet.hs
--- a/Text/Hamlet.hs
+++ b/Text/Hamlet.hs
@@ -1,5 +1,6 @@
 module Text.Hamlet
     ( hamlet
+    , xhamlet
     , hamletWithSettings
     , HamletSettings (..)
     , defaultHamletSettings
diff --git a/Text/Hamlet/Parse.hs b/Text/Hamlet/Parse.hs
--- a/Text/Hamlet/Parse.hs
+++ b/Text/Hamlet/Parse.hs
@@ -135,7 +135,7 @@
                                     _ -> error $ "Invalid delim in parseContent: " ++ [delim]
                         rest' <- parseContent rest
                         return $ x deref' : rest'
-                    _ -> error "Invalid branch in parseContent"
+                    (_, "") -> error $ "Missing ending delimiter in " ++ s
             case a of
                 "" -> return b
                 _ -> return $ ContentRaw a : b
@@ -334,14 +334,15 @@
 closeTag :: HamletSettings -> String -> CloseStyle
 closeTag h s =
     if canBeEmpty s
-        then (if hamletCloseEmpties h then CloseInside else NoClose)
-        else CloseSeparate
+        then CloseSeparate
+        else (if hamletCloseEmpties h then CloseInside else NoClose)
   where
     canBeEmpty "img" = False
     canBeEmpty "link" = False
     canBeEmpty "meta" = False
     canBeEmpty "br" = False
     canBeEmpty "hr" = False
+    canBeEmpty "input" = False
     canBeEmpty _ = True
 
 parseConds :: HamletSettings
diff --git a/Text/Hamlet/Quasi.hs b/Text/Hamlet/Quasi.hs
--- a/Text/Hamlet/Quasi.hs
+++ b/Text/Hamlet/Quasi.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE TemplateHaskell #-}
 module Text.Hamlet.Quasi
     ( hamlet
+    , xhamlet
     , hamletWithSettings
     ) where
 
@@ -103,6 +104,13 @@
 -- | Calls 'hamletWithSettings' with 'defaultHamletSettings'.
 hamlet :: QuasiQuoter
 hamlet = hamletWithSettings defaultHamletSettings
+
+-- | Calls 'hamletWithSettings' using XHTML 1.0 Strict settings.
+xhamlet :: QuasiQuoter
+xhamlet = hamletWithSettings $ HamletSettings doctype True where
+    doctype =
+      "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" " ++
+      "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
 
 -- | A quasi-quoter that converts Hamlet syntax into a function of form:
 --
diff --git a/hamlet.cabal b/hamlet.cabal
--- a/hamlet.cabal
+++ b/hamlet.cabal
@@ -1,5 +1,5 @@
 name:            hamlet
-version:         0.0.0
+version:         0.0.1
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
diff --git a/runtests.hs b/runtests.hs
--- a/runtests.hs
+++ b/runtests.hs
@@ -42,6 +42,9 @@
     , testCase "enum" caseEnum
     , testCase "list chain" caseListChain
     , testCase "enum chain" caseEnumChain
+    , testCase "script not empty" caseScriptNotEmpty
+    , testCase "meta empty" caseMetaEmpty
+    , testCase "input empty" caseInputEmpty
     ]
 
 data Url = Home
@@ -221,3 +224,16 @@
 $forall getArg.*getArgM.getArg.getArg.*getArgM.*enum x
     @x.*murl@
 |]
+
+caseScriptNotEmpty :: Assertion
+caseScriptNotEmpty = helper "<script></script>" [$hamlet|%script|]
+
+caseMetaEmpty :: Assertion
+caseMetaEmpty = do
+    helper "<meta>" [$hamlet|%meta|]
+    helper "<meta/>" [$xhamlet|%meta|]
+
+caseInputEmpty :: Assertion
+caseInputEmpty = do
+    helper "<input>" [$hamlet|%input|]
+    helper "<input/>" [$xhamlet|%input|]
