diff --git a/happstack-server.cabal b/happstack-server.cabal
--- a/happstack-server.cabal
+++ b/happstack-server.cabal
@@ -1,5 +1,5 @@
 Name:                happstack-server
-Version:             7.9.0
+Version:             7.9.2
 Synopsis:            Web related tools and services.
 Description:         Happstack Server provides an HTTP server and a rich set of functions for routing requests, handling query parameters, generating responses, working with cookies, serving files, and more. For in-depth documentation see the Happstack Crash Course <http://happstack.com/docs/crashcourse/index.html>
 License:             BSD3
@@ -13,7 +13,7 @@
 Extra-Source-Files:  tests/Happstack/Server/Tests.hs README.md
 
 tested-with:
-  GHC == 9.8.1
+  GHC == 9.8.2
   GHC == 9.6.3
   GHC == 9.4.7
   GHC == 9.2.8
@@ -74,7 +74,7 @@
                        Paths_happstack_server
 
   if flag(network-uri)
-     build-depends:    network     >= 3.0.0 && < 3.2,
+     build-depends:    network     >= 3.0.0 && < 3.3,
                        network-uri >= 2.6 && < 2.7
   else
      build-depends:    network               < 2.6
diff --git a/src/Happstack/Server/Internal/Listen.hs b/src/Happstack/Server/Internal/Listen.hs
--- a/src/Happstack/Server/Internal/Listen.hs
+++ b/src/Happstack/Server/Internal/Listen.hs
@@ -1,6 +1,7 @@
 {-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables #-}
 module Happstack.Server.Internal.Listen(listen, listen',listenOn,listenOnIPv4) where
 
+import Data.Maybe                               (isNothing)
 import Happstack.Server.Internal.Types          (Conf(..), Request, Response)
 import Happstack.Server.Internal.Handler        (request)
 import Happstack.Server.Internal.Socket         (acceptLite)
@@ -118,7 +119,7 @@
       infi :: IO ()
       infi = loop `catchSome` pe >> infi
 
-  infi `finally` (Socket.close s >> forceTimeoutAll tm)
+  infi `finally` (Socket.close s >> when (isNothing $ threadGroup conf) (forceTimeoutAll tm))
 
 {--
 #ifndef mingw32_HOST_OS
diff --git a/src/Happstack/Server/Internal/Types.hs b/src/Happstack/Server/Internal/Types.hs
--- a/src/Happstack/Server/Internal/Types.hs
+++ b/src/Happstack/Server/Internal/Types.hs
@@ -117,7 +117,7 @@
     , validator   :: Maybe (Response -> IO Response) -- ^ a function to validate the output on-the-fly
     , logAccess   :: forall t. FormatTime t => Maybe (LogAccess t) -- ^ function to log access requests (see also: 'logMAccess')
     , timeout     :: Int             -- ^ number of seconds to wait before killing an inactive thread
-    , threadGroup :: Maybe TG.ThreadGroup -- ^ ThreadGroup for registering spawned threads for handling requests
+    , threadGroup :: Maybe TG.ThreadGroup -- ^ ThreadGroup for registering spawned threads for handling requests.
     }
 
 -- | Default configuration contains no validator and the port is set to 8000
diff --git a/src/Happstack/Server/Response.hs b/src/Happstack/Server/Response.hs
--- a/src/Happstack/Server/Response.hs
+++ b/src/Happstack/Server/Response.hs
@@ -26,6 +26,9 @@
     , ifModifiedSince
     ) where
 
+#if MIN_VERSION_xhtml(3000,3,0)
+import qualified Data.ByteString.Builder         as L
+#endif
 import qualified Data.ByteString.Char8           as B
 import qualified Data.ByteString.Lazy.Char8      as L
 import qualified Data.ByteString.Lazy.UTF8       as LU (fromString)
@@ -140,8 +143,11 @@
 
 instance ToMessage XHtml.Html where
     toContentType _ = B.pack "text/html; charset=UTF-8"
+#if MIN_VERSION_xhtml(3000,3,0)
+    toMessage = L.toLazyByteString . XHtml.renderHtml
+#else
     toMessage = LU.fromString . XHtml.renderHtml
-
+#endif
 instance ToMessage Blaze.Html where
     toContentType _ = B.pack "text/html; charset=UTF-8"
     toMessage       = Blaze.renderHtml
diff --git a/src/Happstack/Server/SimpleHTTP.hs b/src/Happstack/Server/SimpleHTTP.hs
--- a/src/Happstack/Server/SimpleHTTP.hs
+++ b/src/Happstack/Server/SimpleHTTP.hs
@@ -44,6 +44,7 @@
     , bindPort
     , bindIPv4
     , parseConfig
+    , runWebT
     , waitForTermination
     -- * Re-exported modules
     -- ** Basic ServerMonad functionality
