diff --git a/app/Main.hs b/app/Main.hs
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -489,9 +489,8 @@
                          >> yield (T.pack "\n") )  -- want that newline at the end
                     >-> PT.toHandle hOut
 
-    -- Finish up by closing handles just in case
-    IO.hClose hIn
-    IO.hClose hOut
+    -- Finish up by closing file if written
+    unless (null . output $ opts) (IO.hClose hOut)
 
 -- Legacy function
 modifyFastaCloneMap :: Options -> IO ()
diff --git a/modify-fasta.cabal b/modify-fasta.cabal
--- a/modify-fasta.cabal
+++ b/modify-fasta.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                modify-fasta
-version:             0.8.1.1
+version:             0.8.1.2
 synopsis:            Modify fasta (and CLIP) files in several optional ways
 -- description:         
 homepage:            https://github.com/GregorySchwartz/modify-fasta
