diff --git a/Changelog.md b/Changelog.md
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,3 +1,8 @@
+### 1.6.4.1
+
+- Replace dependency package *data-default-class* with *data-default*.
+- Refactor function *handleStatsExceptions*.
+
 ### 1.6.4
 
 - Drop support for *time &lt; 1.9.1*.
diff --git a/NgxExport/Healthcheck.hs b/NgxExport/Healthcheck.hs
--- a/NgxExport/Healthcheck.hs
+++ b/NgxExport/Healthcheck.hs
@@ -73,7 +73,7 @@
 #ifdef HEALTHCHECK_HTTPS
 import           Data.HashMap.Strict (HashMap)
 import qualified Data.HashMap.Strict as HM
-import           Data.Default.Class
+import           Data.Default
 import           Network.HTTP.Client.TLS
 import           Network.Connection
 import           Network.TLS hiding (HashSHA256)
@@ -623,12 +623,11 @@
         modifyResponse $ setContentType "application/json"
         writeLBS $ encode s
 
-handleStatsExceptions :: String -> Snap () -> Snap ()
-handleStatsExceptions cmsg = handleAny $ \e ->
-    writeErrorResponse 500 $ show (e :: SomeException)
+handleStatsExceptions :: ByteString -> Snap () -> Snap ()
+handleStatsExceptions cmsg = handleAny $ writeErrorResponse 500 . show
     where writeErrorResponse c msg = do
-              modifyResponse $ setResponseStatus c $ T.encodeUtf8 $ T.pack cmsg
-              writeBS $ T.encodeUtf8 $ T.pack msg
+              modifyResponse $ setResponseStatus c cmsg
+              writeBS $ C8.pack msg
 
 statsServer :: ByteString -> Bool -> IO L.ByteString
 statsServer cf fstRun = do
diff --git a/ngx-export-healthcheck.cabal b/ngx-export-healthcheck.cabal
--- a/ngx-export-healthcheck.cabal
+++ b/ngx-export-healthcheck.cabal
@@ -1,5 +1,5 @@
 name:                  ngx-export-healthcheck
-version:               1.6.4
+version:               1.6.4.1
 synopsis:              Active health checks and monitoring of Nginx upstreams
 description:           Active health checks and monitoring of Nginx upstreams.
         .
@@ -52,7 +52,7 @@
   if flag(HealthcheckHttps)
     build-depends:     http-client-tls >= 0.3.4
                      , unordered-containers
-                     , data-default-class
+                     , data-default >= 0.8
                      , crypton-connection
                      , crypton-x509
                      , crypton-x509-store
