diff --git a/Text/ICalendar/Parser.hs b/Text/ICalendar/Parser.hs
--- a/Text/ICalendar/Parser.hs
+++ b/Text/ICalendar/Parser.hs
@@ -12,7 +12,7 @@
 
 import           Control.Applicative
 import           Control.Monad
-import           Control.Monad.Error
+import           Control.Monad.Except
 import           Control.Monad.RWS          (runRWS)
 import           Data.ByteString.Lazy       (ByteString)
 import qualified Data.ByteString.Lazy.Char8 as B
@@ -70,4 +70,4 @@
 
 runCP :: DecodingFunctions -> ContentParser a
       -> (Either String a, (SourcePos, [Content]), [String])
-runCP s = ((flip .) . flip) runRWS s (undefined, undefined) . runErrorT
+runCP s = ((flip .) . flip) runRWS s (undefined, undefined) . runExceptT
diff --git a/Text/ICalendar/Parser/Common.hs b/Text/ICalendar/Parser/Common.hs
--- a/Text/ICalendar/Parser/Common.hs
+++ b/Text/ICalendar/Parser/Common.hs
@@ -5,11 +5,12 @@
 
 import           Control.Applicative
 import           Control.Arrow                (second)
-import           Control.Monad.Error          hiding (mapM)
+import           Control.Monad                (when, unless, (<=<))
+import           Control.Monad.Except         hiding (mapM)
 import           Control.Monad.RWS            (MonadState (get, put),
                                                MonadWriter (tell), RWS, asks,
                                                modify)
-import qualified Data.ByteString.Lazy.Builder as Bu
+import qualified Data.ByteString.Builder      as Bu
 import           Data.ByteString.Lazy.Char8   (ByteString)
 import qualified Data.ByteString.Lazy.Char8   as B
 import           Data.CaseInsensitive         (CI)
@@ -50,7 +51,7 @@
 
 type TextParser = P.Parsec ByteString DecodingFunctions
 
-type ContentParser = ErrorT String -- Fatal errors.
+type ContentParser = ExceptT String -- Fatal errors.
                             (RWS DecodingFunctions
                                  [String] -- Warnings.
                                  (P.SourcePos, [Content]))
diff --git a/Text/ICalendar/Parser/Components.hs b/Text/ICalendar/Parser/Components.hs
--- a/Text/ICalendar/Parser/Components.hs
+++ b/Text/ICalendar/Parser/Components.hs
@@ -1,10 +1,12 @@
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE RecordWildCards   #-}
+{-# LANGUAGE FlexibleContexts  #-}
 module Text.ICalendar.Parser.Components where
 
 import           Control.Applicative
 import           Control.Arrow        ((&&&))
-import           Control.Monad.Error  hiding (mapM)
+import           Control.Monad        (when)
+import           Control.Monad.Except hiding (mapM)
 import           Control.Monad.RWS    (MonadState (get), tell)
 import qualified Data.CaseInsensitive as CI
 import qualified Data.Foldable        as F
@@ -40,11 +42,11 @@
         recur Nothing = Nothing
         recur (Just (RecurrenceIdDate x _ _)) = Just (Left x)
         recur (Just (RecurrenceIdDateTime x _ _)) = Just (Right x)
-        f :: Ord b => (a -> b) -> Set a -> ContentParser (M.Map b a)
+        f :: (Show b, Ord b) => (a -> b) -> Set a -> ContentParser (M.Map b a)
         f g = F.foldlM h M.empty
           where h m e = let k = g e
                          in if k `M.member` m
-                               then throwError "Duplicate UID/RecurId/TZID."
+                               then throwError $ "Duplicate UID/RecurId/TZID " ++ show k
                                else return $ M.insert k e m
 parseVCalendar _ = throwError "parseVCalendar: Content given not a VCALENDAR\
                               \ component."
diff --git a/Text/ICalendar/Parser/Content.hs b/Text/ICalendar/Parser/Content.hs
--- a/Text/ICalendar/Parser/Content.hs
+++ b/Text/ICalendar/Parser/Content.hs
@@ -4,7 +4,7 @@
 import           Control.Applicative
 import           Control.Monad
 import           Data.ByteString.Lazy         (ByteString)
-import qualified Data.ByteString.Lazy.Builder as Bu
+import qualified Data.ByteString.Builder      as Bu
 import           Data.CaseInsensitive         (CI)
 import           Data.Char
 import           Data.Monoid
diff --git a/Text/ICalendar/Parser/Parameters.hs b/Text/ICalendar/Parser/Parameters.hs
--- a/Text/ICalendar/Parser/Parameters.hs
+++ b/Text/ICalendar/Parser/Parameters.hs
@@ -2,7 +2,8 @@
 module Text.ICalendar.Parser.Parameters where
 
 import           Control.Applicative
-import           Control.Monad.Error
+import           Control.Monad              (void, when)
+import           Control.Monad.Except
 import           Control.Monad.RWS          (MonadWriter (tell))
 import           Data.ByteString.Lazy.Char8 (ByteString)
 import qualified Data.ByteString.Lazy.Char8 as B
diff --git a/Text/ICalendar/Parser/Properties.hs b/Text/ICalendar/Parser/Properties.hs
--- a/Text/ICalendar/Parser/Properties.hs
+++ b/Text/ICalendar/Parser/Properties.hs
@@ -5,7 +5,8 @@
 module Text.ICalendar.Parser.Properties where
 
 import           Control.Applicative
-import           Control.Monad.Error          hiding (mapM)
+import           Control.Monad                (when, (<=<))
+import           Control.Monad.Except         hiding (mapM)
 import           Control.Monad.RWS            (asks)
 import qualified Data.ByteString.Base64.Lazy  as B64
 import qualified Data.ByteString.Lazy.Char8   as B
diff --git a/Text/ICalendar/Printer.hs b/Text/ICalendar/Printer.hs
--- a/Text/ICalendar/Printer.hs
+++ b/Text/ICalendar/Printer.hs
@@ -16,8 +16,8 @@
                                                MonadWriter (tell), RWS, asks,
                                                modify, runRWS)
 import           Data.ByteString.Lazy         (ByteString)
-import           Data.ByteString.Lazy.Builder (Builder)
-import qualified Data.ByteString.Lazy.Builder as Bu
+import           Data.ByteString.Builder      (Builder)
+import qualified Data.ByteString.Builder      as Bu
 import qualified Data.ByteString.Lazy.Char8   as BS
 import qualified Data.CaseInsensitive         as CI
 import           Data.Char                    (ord, toUpper)
@@ -564,7 +564,7 @@
     toParam (Dir x) = [("DIR", [(NeedQuotes, T.pack $ show x)])]
 
 instance ToParam DateTime where
-    toParam ZonedDateTime {..} = [("TZID", [(Optional, dateTimeZone)])]
+    toParam ZonedDateTime {..} = [("TZID", [(NoQuotes, dateTimeZone)])]
     toParam _ = []
 
 instance ToParam DTEnd where
diff --git a/iCalendar.cabal b/iCalendar.cabal
--- a/iCalendar.cabal
+++ b/iCalendar.cabal
@@ -1,30 +1,27 @@
+cabal-version:       3.0
 name:                iCalendar
-version:             0.4.0.5
+version:             0.4.1.0
 synopsis:            iCalendar data types, parser, and printer.
 description:         Data definitions, parsing and printing of the iCalendar
                      format (RFC5545).
 homepage:            http://github.com/chrra/iCalendar
 bug-reports:         http://github.com/chrra/iCalendar/issues
-license:             BSD3
+license:             BSD-3-Clause
 license-file:        LICENSE
 author:              Christian Rødli Amble
-maintainer:          cra@cra.no
+maintainer:          jakob.schoettl@intensovet.de
 copyright:           (c) Tingtun
 stability:           experimental
 category:            Text
 build-type:          Simple
-tested-with:         GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2
-cabal-version:       >=1.8
+tested-with:         GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.2, GHC==9.6.5
 
 source-repository head
   type:              git
   location:          git://github.com/chrra/iCalendar.git
 
-flag network-uri
-   description: Get Network.URI from the network-uri package
-   default: True
-
 library
+  default-language:    Haskell2010
   exposed-modules:     Text.ICalendar.Types
                      , Text.ICalendar.Parser
                      , Text.ICalendar.Printer
@@ -36,17 +33,22 @@
                      , Text.ICalendar.Parser.Properties
                      , Paths_iCalendar
 
-  if flag(network-uri)
-    build-depends: network-uri >= 2.6, network >= 2.6 && < 2.7
-  else
-    build-depends: network >= 2.4 && < 2.6
+  autogen-modules:     Paths_iCalendar
 
   if !impl(ghc >= 8.0)
     build-depends: semigroups == 0.18.*
 
-  build-depends:       base >=4.5 && <5, time >=1.5, data-default >=0.3
-                     , case-insensitive >=0.4
-                     , bytestring >=0.10 && < 0.11, parsec >=3.1.0
-                     , text, containers >= 0.5 && < 0.6, mime >=0.4.0.2
-                     , mtl >=2.1.0, old-locale, base64-bytestring ==1.0.*
+  build-depends:       base >=4.5 && <5,
+                       containers >= 0.5 && < 0.7,
+                       bytestring >=0.11 && <1.0.0,
+                       base64-bytestring >= 1.2.1 && < 1.3,
+                       case-insensitive >= 1.2.1 && < 1.3,
+                       mtl >= 2.3.1 && < 2.4,
+                       text >= 2.0.2 && < 2.1,
+                       data-default >= 0.7.1 && < 0.8,
+                       old-locale >= 1.0.0 && < 1.1,
+                       mime >= 0.4.0 && < 0.5,
+                       network-uri >= 2.6.4 && < 2.7,
+                       parsec >= 3.1.16 && < 3.2,
+                       time >= 1.12.2 && < 1.13,
   ghc-options:       -Wall
