diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 1.1.0 (2018-10-15)
+
+ * Fix for previous workaround.  Repairs writeBamFile.
+
 # 1.1.0 (2018-10-12)
 
  * Work around changes in exceptions-0.10.0.  This version should
diff --git a/biohazard.cabal b/biohazard.cabal
--- a/biohazard.cabal
+++ b/biohazard.cabal
@@ -1,5 +1,5 @@
 Name:                biohazard
-Version:             1.1.0
+Version:             1.1.1
 Synopsis:            bioinformatics support library
 Description:         This is a collection of modules I separated from
                      various bioinformatics tools.
diff --git a/src/Bio/Bam/Index.hs b/src/Bio/Bam/Index.hs
--- a/src/Bio/Bam/Index.hs
+++ b/src/Bio/Bam/Index.hs
@@ -18,7 +18,6 @@
 import Bio.Bam.Regions              ( Region(..), Subsequence(..) )
 import Bio.Iteratee
 import Bio.Prelude
-import System.Posix.Files           ( fileExist )
 
 import qualified Bio.Bam.Regions                as R
 import qualified Data.IntMap.Strict             as M
diff --git a/src/Bio/Iteratee/Iteratee.hs b/src/Bio/Iteratee/Iteratee.hs
--- a/src/Bio/Iteratee/Iteratee.hs
+++ b/src/Bio/Iteratee/Iteratee.hs
@@ -288,23 +288,35 @@
 ioBind_ :: MonadIO m => IO a -> Iteratee s m b -> Iteratee s m b
 ioBind_ m b = Iteratee $ \onDone onCont -> liftIO m >> runIter b onDone onCont
 
--- | Runs an 'Iteratee' in between an 'IO' action to acquire a resource
--- and one to release it.  'Iteratee' can't be an instance of
--- 'CIO.MonadMask', so 'CIO.bracket' isn't defined for it.  However, if
--- we restrict the acquire/release actions to 'IO', which is the most
--- important use case anyway, we can directly implement this weaker
--- version.
-class MonadIO m => MonadBracketIO m where
+class (MonadCatch m, MonadIO m) => MonadBracketIO m where
+    altmask :: ((forall a. m a -> m a) -> m b) -> m b
+
+    -- | Runs an 'Iteratee' in between an 'IO' action to acquire a
+    -- resource and one to release it.  'Iteratee' can't be an instance
+    -- of 'CIO.MonadMask', so 'CIO.bracket' isn't defined for it.
+    -- However, if we restrict the acquire/release actions to 'IO',
+    -- which is the most important use case anyway, we can directly
+    -- implement this weaker version.
     bracketIO :: IO a -> (a -> IO b) -> (a -> m c) -> m c
 
 instance MonadBracketIO IO where
+    {-# INLINE altmask #-}
+    altmask = CIO.mask
+
     {-# INLINE bracketIO #-}
     bracketIO = CIO.bracket
 
 instance (MonadBracketIO m, Nullable s) => MonadBracketIO (Iteratee s m) where
+    {-# INLINE altmask #-}
+    altmask q = Iteratee $ \od oc -> altmask $ \u -> runIter (q $ ilift u) od oc
+
     {-# INLINE bracketIO #-}
     bracketIO acquire release use =
-        Iteratee $ \od oc -> bracketIO acquire release (\h -> runIter (use h) od oc)
+      Iteratee $ \od oc -> altmask $ \u ->
+          runIter (acquire `ioBind` \resource ->
+                   ilift u (use resource) `CIO.onException` liftIO (release resource) >>= \result ->
+                   release resource `ioBind_` return result) od oc
+
 
 -- | Convert one stream into another with the supplied mapping function.
 -- This function operates on whole chunks at a time, contrasting to
diff --git a/src/Bio/Util/Storable.hs b/src/Bio/Util/Storable.hs
--- a/src/Bio/Util/Storable.hs
+++ b/src/Bio/Util/Storable.hs
@@ -19,10 +19,6 @@
 
 import Bio.Prelude
 
-#if defined(HAVE_BYTESWAP_PRIMOPS)
-import GHC.Word ( byteSwap16, byteSwap32 )
-#endif
-
 peekWord8 :: Ptr a -> IO Word8
 peekWord8 = peek . castPtr
 
