diff --git a/Data/ASN1/BER.hs b/Data/ASN1/BER.hs
--- a/Data/ASN1/BER.hs
+++ b/Data/ASN1/BER.hs
@@ -156,23 +156,29 @@
 		Left err -> Left (maybe (ASN1ParsingFail "unknown") id $ fromException err)
 		Right x  -> Right x
 
-encodeASN1Stream :: Monad m => [ASN1] -> Iteratee ByteString m a -> m (Either SomeException a)
-encodeASN1Stream l p = E.run (E.enumList 1 l $$ E.joinI $ enumWriteBytes $$ p)
+{-| encode an ASN1 Stream as lazy bytestring -}
+encodeASN1Stream :: [ASN1] -> Either ASN1Err L.ByteString
+encodeASN1Stream l =
+	case runIdentity $ E.run (E.enumList 1 l $$ E.joinI $ enumWriteBytes $$ E.consume) of
+		Left err -> Left (maybe (ASN1ParsingFail "unknown") id $ fromException err)
+		Right x  -> Right $ L.fromChunks x
 
 {-# DEPRECATED decodeASN1s "use stream types with decodeASN1Stream" #-}
 decodeASN1s :: L.ByteString -> Either ASN1Err [ASN1t]
-decodeASN1s l = either (Left) (Right . ofStream) $ decodeASN1Stream l
+decodeASN1s = either (Left) (Right . ofStream) . decodeASN1Stream
 
 {-# DEPRECATED decodeASN1 "use stream types with decodeASN1Stream" #-}
 decodeASN1 :: L.ByteString -> Either ASN1Err ASN1t
-decodeASN1 = either (Left) (Right . head) . decodeASN1s
+decodeASN1 = either (Left) (Right . head . ofStream) . decodeASN1Stream
 
 {-# DEPRECATED encodeASN1s "use stream types with encodeASN1Stream" #-}
 encodeASN1s :: [ASN1t] -> L.ByteString
-encodeASN1s l = case runIdentity (encodeASN1Stream (toStream l) E.consume) of
-	Left _  -> error "encoding failed"
-	Right x -> L.fromChunks x
+encodeASN1s s = case encodeASN1Stream $ toStream s of
+	Left err -> error $ show err
+	Right x  -> x
 
 {-# DEPRECATED encodeASN1 "use stream types with encodeASN1Stream" #-}
 encodeASN1 :: ASN1t -> L.ByteString
-encodeASN1 = encodeASN1s . (:[])
+encodeASN1 s = case encodeASN1Stream $ toStream [s] of
+	Left err -> error $ show err
+	Right x  -> x
diff --git a/Data/ASN1/DER.hs b/Data/ASN1/DER.hs
--- a/Data/ASN1/DER.hs
+++ b/Data/ASN1/DER.hs
@@ -104,28 +104,34 @@
 
 {-| decode a lazy bytestring as an ASN1 stream -}
 decodeASN1Stream :: L.ByteString -> Either ASN1Err [ASN1]
-decodeASN1Stream l = do
+decodeASN1Stream l =
 	case runIdentity (iterateByteString l E.consume) of
 		Left err -> Left (maybe (ASN1ParsingFail "unknown") id $ fromException err)
 		Right x  -> Right x
 
-encodeASN1Stream :: Monad m => [ASN1] -> Iteratee ByteString m a -> m (Either SomeException a)
-encodeASN1Stream l p = E.run (E.enumList 1 l $$ E.joinI $ enumWriteBytes $$ p)
+{-| encode an ASN1 Stream as lazy bytestring -}
+encodeASN1Stream :: [ASN1] -> Either ASN1Err L.ByteString
+encodeASN1Stream l =
+	case runIdentity $ E.run (E.enumList 1 l $$ E.joinI $ enumWriteBytes $$ E.consume) of
+		Left err -> Left (maybe (ASN1ParsingFail "unknown") id $ fromException err)
+		Right x  -> Right $ L.fromChunks x
 
 {-# DEPRECATED decodeASN1s "use stream types with decodeASN1Stream" #-}
 decodeASN1s :: L.ByteString -> Either ASN1Err [ASN1t]
-decodeASN1s l = either (Left) (Right . ofStream) $ decodeASN1Stream l
+decodeASN1s = either (Left) (Right . ofStream) . decodeASN1Stream
 
 {-# DEPRECATED decodeASN1 "use stream types with decodeASN1Stream" #-}
 decodeASN1 :: L.ByteString -> Either ASN1Err ASN1t
-decodeASN1 = either (Left) (Right . head) . decodeASN1s
+decodeASN1 = either (Left) (Right . head . ofStream) . decodeASN1Stream
 
 {-# DEPRECATED encodeASN1s "use stream types with encodeASN1Stream" #-}
 encodeASN1s :: [ASN1t] -> L.ByteString
-encodeASN1s l = case runIdentity (encodeASN1Stream (toStream l) E.consume) of
-	Left _  -> error "encoding failed"
-	Right x -> L.fromChunks x
+encodeASN1s s = case encodeASN1Stream $ toStream s of
+	Left err -> error $ show err
+	Right x  -> x
 
 {-# DEPRECATED encodeASN1 "use stream types with encodeASN1Stream" #-}
 encodeASN1 :: ASN1t -> L.ByteString
-encodeASN1 = encodeASN1s . (:[])
+encodeASN1 s = case encodeASN1Stream $ toStream [s] of
+	Left err -> error $ show err
+	Right x  -> x
diff --git a/asn1-data.cabal b/asn1-data.cabal
--- a/asn1-data.cabal
+++ b/asn1-data.cabal
@@ -1,5 +1,5 @@
 Name:                asn1-data
-Version:             0.4.0
+Version:             0.4.1
 Description:
     ASN1 data reader and writer in raw form with supports for high level forms of ASN1 (BER, CER and DER).
     .
