diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.0.20221012
+
+* Fix `commuteHtmlT` in favor of newly added `commuteHtmlT2`
+
 ## 0.0.20220526
 
 This release adds some extra functions for running different monad
diff --git a/lucid2.cabal b/lucid2.cabal
--- a/lucid2.cabal
+++ b/lucid2.cabal
@@ -1,5 +1,5 @@
 name:                lucid2
-version:             0.0.20220526
+version:             0.0.20221012
 synopsis:            Clear to write, read and edit DSL for HTML
 description:
   Clear to write, read and edit DSL for HTML.
@@ -33,7 +33,7 @@
                      Lucid.Html5
 
   -- GHC boot libraries
-  build-depends:     base          >= 4.8 && < 4.17
+  build-depends:     base          >= 4.8 && < 4.18
                    , bytestring    >= 0.10.12.0
                    , containers    >= 0.6.5.1
                    , transformers  >= 0.5.6.2
diff --git a/src/Lucid/Base.hs b/src/Lucid/Base.hs
--- a/src/Lucid/Base.hs
+++ b/src/Lucid/Base.hs
@@ -23,7 +23,7 @@
   ,evalHtmlT
   ,runHtmlT
   ,generalizeHtmlT
-  ,commuteHtmlT
+  ,commuteHtmlT2
   ,hoistHtmlT
   -- * Combinators
   ,makeElement
@@ -41,6 +41,7 @@
 
    -- * Deprecated
   ,relaxHtmlT
+  ,commuteHtmlT
   )
   where
 
@@ -337,12 +338,12 @@
 -- exampleHtml' = evalState (commuteHtmlT exampleHtml) 1
 -- @
 --
-commuteHtmlT :: (Monad m, Monad n)
+commuteHtmlT2 :: (Monad m, Monad n)
              => HtmlT m a      -- ^ unpurely generated HTML
              -> m (HtmlT n a)  -- ^ Commuted monads. /Note:/ @n@ can be 'Identity'
-commuteHtmlT h = do
+commuteHtmlT2 h = do
   (builder, a) <- runHtmlT h
-  return . HtmlT $ put builder >> return a
+  return . HtmlT $ modify' (<> builder) >> return a
 
 -- | Evaluate the HTML to its return value. Analogous to @evalState@.
 --
@@ -453,3 +454,11 @@
 relaxHtmlT :: Monad m => HtmlT Identity a -> HtmlT m a
 relaxHtmlT = undefined
 {-# DEPRECATED relaxHtmlT "DO NOT USE. This was exported accidentally and throws an exception." #-}
+
+commuteHtmlT :: (Monad m, Monad n)
+             => HtmlT m a      -- ^ unpurely generated HTML
+             -> m (HtmlT n a)  -- ^ Commuted monads. /Note:/ @n@ can be 'Identity'
+commuteHtmlT h = do
+  (builder, a) <- runHtmlT h
+  return . HtmlT $ put builder >> return a
+{-# DEPRECATED commuteHtmlT "This has incorrect behavior and will lose HTML output. See commuteHtmlT2." #-}
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -30,6 +30,7 @@
   describe "attributes" testAttributes
   describe "special-elements" testSpecials
   describe "self-closing" testSelfClosing
+  describe "commute" testCommute
 
 (==?*) :: (Eq a, Show a) => a -> [a] -> Assertion
 x ==?* xs | x `elem` xs = return ()
@@ -154,3 +155,12 @@
      it "input"
         (renderText (input_ [type_ "text"]) `shouldBe`
          "<input type=\"text\">")
+
+testCommute :: Spec
+testCommute = do
+  it "commutes" $ do
+    let stateAction :: HtmlT (Control.Monad.State.Strict.State [Integer]) ()
+        stateAction = div_ [class_ "inside"] $ pure ()
+        (fragment, _s) = runState (commuteHtmlT2 stateAction) [0]
+    renderText (div_ [class_ "outside"] fragment) `shouldBe`
+     "<div class=\"outside\"><div class=\"inside\"></div></div>"
