diff --git a/llvm-general.cabal b/llvm-general.cabal
--- a/llvm-general.cabal
+++ b/llvm-general.cabal
@@ -1,5 +1,5 @@
 name: llvm-general
-version: 3.4.3.0
+version: 3.4.3.1
 license: BSD3
 license-file: LICENSE
 author: Benjamin S.Scarlet <fgthb0@greynode.net>
@@ -16,7 +16,7 @@
 	handles almost all of the stateful complexities of using the LLVM API to build IR; and it supports moving IR not
 	only from Haskell into LLVM C++ objects, but the other direction - from LLVM C++ into Haskell.
   .
-  For haddock, see <http://bscarlet.github.io/llvm-general/3.4.3.0/doc/html/llvm-general/index.html>.
+  For haddock, see <http://bscarlet.github.io/llvm-general/3.4.3.1/doc/html/llvm-general/index.html>.
 extra-source-files:
   src/LLVM/General/Internal/FFI/Analysis.h
   src/LLVM/General/Internal/FFI/BinaryOperator.h
@@ -40,7 +40,7 @@
   type: git
   location: git://github.com/bscarlet/llvm-general.git
   branch: llvm-3.4
-  tag: v3.4.3.0
+  tag: v3.4.3.1
 
 flag shared-llvm
   description: link against llvm shared rather than static library
@@ -64,7 +64,7 @@
     parsec >= 3.1.3,
     array >= 0.4.0.0,
     setenv >= 0.1.0,
-    llvm-general-pure == 3.4.3.0
+    llvm-general-pure == 3.4.3.1
   extra-libraries: stdc++
   hs-source-dirs: src
   extensions:
@@ -199,8 +199,8 @@
     HUnit >= 1.2.4.2,
     test-framework-quickcheck2 >= 0.3.0.1,
     QuickCheck >= 2.5.1.1,
-    llvm-general == 3.4.3.0,
-    llvm-general-pure == 3.4.3.0,
+    llvm-general == 3.4.3.1,
+    llvm-general-pure == 3.4.3.1,
     containers >= 0.4.2.1,
     mtl >= 2.0.1.0
   hs-source-dirs: test
diff --git a/src/LLVM/General/Internal/RawOStream.hs b/src/LLVM/General/Internal/RawOStream.hs
--- a/src/LLVM/General/Internal/RawOStream.hs
+++ b/src/LLVM/General/Internal/RawOStream.hs
@@ -24,19 +24,14 @@
   path <- encodeM path
   excl <- encodeM excl
   binary <- encodeM binary
-  outputRef <- liftIO $ newIORef Nothing
   msgPtr <- alloca
   errorRef <- liftIO $ newIORef undefined
-  failed <- decodeM =<< (liftIO $ FFI.withFileRawOStream path excl binary msgPtr $ \os -> do
-                           r <- runErrorT (c os)
-                           writeIORef errorRef r)
-  when failed $ fail =<< decodeM msgPtr
+  succeeded <- decodeM =<< (liftIO $ FFI.withFileRawOStream path excl binary msgPtr $ \os -> do
+                              r <- runErrorT (c os)
+                              writeIORef errorRef r)
+  unless succeeded $ fail =<< decodeM msgPtr
   e <- liftIO $ readIORef errorRef
-  case e of
-    Left e -> fail e
-    _ -> do
-      Just r <- liftIO $ readIORef outputRef
-      return r
+  either fail return e
 
 withBufferRawOStream :: 
   (MonadIO m, DecodeM IO a (Ptr CChar, CSize))
