diff --git a/spreadsheet.cabal b/spreadsheet.cabal
--- a/spreadsheet.cabal
+++ b/spreadsheet.cabal
@@ -1,5 +1,5 @@
 Name:             spreadsheet
-Version:          0.1.3.1
+Version:          0.1.3.2
 License:          BSD3
 License-File:     LICENSE
 Author:           Henning Thielemann <haskell@henning-thielemann.de>
@@ -61,7 +61,7 @@
   Location: http://code.haskell.org/~thielema/spreadsheet/
 
 Source-Repository this
-  Tag:      0.1.3.1
+  Tag:      0.1.3.2
   Type:     darcs
   Location: http://code.haskell.org/~thielema/spreadsheet/
 
@@ -93,7 +93,7 @@
 Executable csvreplace
   If flag(buildExamples)
     Build-Depends:
-      bytestring >=0.9 && <0.10
+      bytestring >=0.9 && <0.11
   Else
     Buildable:      False
   GHC-Options:      -Wall
diff --git a/src/CSVReplace.hs b/src/CSVReplace.hs
--- a/src/CSVReplace.hs
+++ b/src/CSVReplace.hs
@@ -70,9 +70,13 @@
 replaceRow template names row =
    ListHT.multiReplace (filter (not . null . fst) $ zip names row) template
 
-replace :: String -> [String] -> Sheet.T -> String
+replaceRowBS :: String -> [String] -> [String] -> BL.ByteString
+replaceRowBS template names row =
+   BL.pack $ replaceRow template names row
+
+replace :: String -> [String] -> Sheet.T -> BL.ByteString
 replace template names =
-   concatMap (replaceRow template names)
+   BL.concat . map (replaceRowBS template names)
 
 
 main :: IO ()
@@ -94,10 +98,10 @@
                (names:rows) ->
                   case optMultiFile flags of
                      Nothing -> do
-                        lift $ putStr $ replace template names rows
+                        lift $ BL.putStr $ replace template names rows
                         forM_ (AExc.exception sheet) $ Exc.throwT
                      Just filePattern ->
                         lift $ forM_ rows $ \row ->
-                           writeFile (replaceRow filePattern names row) $
-                              replaceRow template names row
+                           BL.writeFile (replaceRow filePattern names row) $
+                              replaceRowBS template names row
          _ -> Exc.throwT "I need exactly one template file."
