diff --git a/jsaddle.cabal b/jsaddle.cabal
--- a/jsaddle.cabal
+++ b/jsaddle.cabal
@@ -1,5 +1,5 @@
 name: jsaddle
-version: 0.9.5.0
+version: 0.9.6.0
 cabal-version: >=1.10
 build-type: Simple
 license: MIT
@@ -36,7 +36,7 @@
     else
         build-depends:
             attoparsec >=0.11 && <0.14,
-            containers >=0.5.6.2 && <0.6,
+            containers >=0.5.6.2 && <0.7,
             deepseq >=1.3 && < 1.5,
             filepath >=1.4.0.0 && <1.5,
             ghc-prim,
@@ -45,7 +45,7 @@
             random >= 1.1 && < 1.2,
             ref-tf >=0.4.0.1 && <0.5,
             scientific >=0.3 && <0.4,
-            stm >=2.4.4 && <2.5,
+            stm >=2.4.4 && <2.6,
             time >=1.5.0.1 && <1.9,
             unordered-containers >=0.2 && <0.3,
             vector >=0.10 && <0.13,
@@ -107,12 +107,12 @@
         Language.Javascript.JSaddle.Value
         Language.Javascript.JSaddle.Types
     build-depends:
-        aeson >=0.8.0.2 && <1.3,
-        base <5,
+        aeson >=0.8.0.2 && <1.5,
+        base >=4.9 && <5,
         base64-bytestring >=1.0.0.1 && <1.1,
         bytestring >=0.10.6.0 && <0.11,
-        exceptions >=0.8 && <0.9,
-        lens >=3.8.5 && <4.17,
+        exceptions >=0.8 && <0.11,
+        lens >=3.8.5 && <4.18,
         primitive >=0.6.1.0 && <0.7,
         text >=1.2.1.3 && <1.3,
         transformers >=0.4.2.0 && <0.6
@@ -123,5 +123,3 @@
         cpp-options: -DCHECK_UNCHECKED
     if flag(call-stacks) || flag(check-unchecked)
         cpp-options: -DJSADDLE_HAS_CALL_STACK
-
-
diff --git a/src/Language/Javascript/JSaddle.hs b/src/Language/Javascript/JSaddle.hs
--- a/src/Language/Javascript/JSaddle.hs
+++ b/src/Language/Javascript/JSaddle.hs
@@ -9,7 +9,7 @@
 -- | This package provides an EDSL for calling JavaScript that
 --   can be used both from GHCJS and GHC.  When using GHC
 --   the application is run using Warp and WebSockets to
---   drive a small JavaScipt helper.
+--   drive a small JavaScript helper.
 -----------------------------------------------------------------------------
 
 module Language.Javascript.JSaddle (
@@ -35,10 +35,10 @@
   --
   --   Where it makes sense code examples are given in two forms.  One
   --   that uses 'eval' to run a purely JavaScript version and one that
-  --   uses more of the JSaddle EDSL feature being demonstated.
+  --   uses more of the JSaddle EDSL feature being demonstrated.
 
   -- * Calling Haskell from JavaScript
-  -- | You can call back into haskell from JavaScript using 'fun' to
+  -- | You can call back into Haskell from JavaScript using 'fun' to
   --   convert a Haskell function in the JSM monad into a javascript
   --   value.
 
@@ -52,8 +52,8 @@
   --   and the server will run the Haskell code.  The JSaddle parts will
   --   be executed by sending commands back to the browser.
 
-  --   Although the code JavaScript code is executed in the the strict order
-  --   set out by the EDSL it done asynchonously to the Haskell code.
+  --   Although the JavaScript code is executed in the strict order
+  --   set out by the EDSL it is done asynchronously to the Haskell code.
   --   This improves the performance by reducing the number of round trips
   --   needed between the Haskell and JavaScript code.
 
diff --git a/src/Language/Javascript/JSaddle/Run/Files.hs b/src/Language/Javascript/JSaddle/Run/Files.hs
--- a/src/Language/Javascript/JSaddle/Run/Files.hs
+++ b/src/Language/Javascript/JSaddle/Run/Files.hs
@@ -13,7 +13,6 @@
 
 module Language.Javascript.JSaddle.Run.Files (
     indexHtml
-  , jsaddleJs
   , initState
   , runBatch
   , ghcjsHelpers
@@ -335,41 +334,6 @@
     \    }\n\
     \  };\n\
     \  runBatch(batch);\n\
-    \"
-
--- Use this to generate this string for embedding
--- sed -e 's|\\|\\\\|g' -e 's|^|    \\|' -e 's|$|\\n\\|' -e 's|"|\\"|g' data/jsaddle.js | pbcopy
-jsaddleJs :: ByteString
-jsaddleJs = "\
-    \if(typeof global !== \"undefined\") {\n\
-    \    global.window = global;\n\
-    \    global.WebSocket = require('ws');\n\
-    \}\n\
-    \\n\
-    \var connect = function() {\n\
-    \    var wsaddress =\n\
-    \            typeof window.location === \"undefined\"\n\
-    \                ? \"ws://localhost:3709/\"\n\
-    \                : window.location.protocol.replace('http', 'ws')+\"//\"+window.location.hostname+(window.location.port?(\":\"+window.location.port):\"\");\n\
-    \\n\
-    \    var ws = new WebSocket(wsaddress);\n\
-    \\n\
-    \    ws.onopen = function(e) {\n\
-    \ " <> initState <> "\
-    \\n\
-    \        ws.onmessage = function(e) {\n\
-    \            var batch = JSON.parse(e.data);\n\
-    \\n\
-    \ " <> runBatch (\a -> "ws.send(JSON.stringify(" <> a <> "));") Nothing <> "\
-    \        };\n\
-    \    };\n\
-    \    ws.onerror = function() {\n\
-    \        setTimeout(connect, 1000);\n\
-    \    };\n\
-    \}\n\
-    \\n\
-    \ " <> ghcjsHelpers <> "\
-    \connect();\n\
     \"
 
 ghcjsHelpers :: ByteString
diff --git a/src/Language/Javascript/JSaddle/Types.hs b/src/Language/Javascript/JSaddle/Types.hs
--- a/src/Language/Javascript/JSaddle/Types.hs
+++ b/src/Language/Javascript/JSaddle/Types.hs
@@ -124,6 +124,7 @@
        (defaultOptions, genericToEncoding, ToJSON(..), FromJSON(..), Value)
 import GHC.Generics (Generic)
 import Control.Monad.IO.Unlift (MonadUnliftIO)
+import qualified Control.Monad.Fail as Fail
 #endif
 
 #if MIN_VERSION_base(4,9,0) && defined(CHECK_UNCHECKED)
@@ -165,7 +166,7 @@
 type JSM = IO
 #else
 newtype JSM a = JSM { unJSM :: ReaderT JSContextRef IO a }
-    deriving (Functor, Applicative, Monad, MonadIO, MonadFix, MonadThrow, MonadUnliftIO)
+    deriving (Functor, Applicative, Monad, MonadIO, MonadFix, MonadThrow, MonadUnliftIO, Fail.MonadFail)
 
 instance MonadCatch JSM where
     t `catch` c = JSM (unJSM (syncAfter t) `catch` \e -> unJSM (c e))
@@ -178,6 +179,13 @@
     JSM $ uninterruptibleMask $ \unmask -> unJSM (a $ q unmask)
       where q :: (ReaderT JSContextRef IO a -> ReaderT JSContextRef IO a) -> JSM a -> JSM a
             q unmask (JSM b) = syncAfter . JSM $ unmask b
+#if MIN_VERSION_exceptions(0,9,0)
+  generalBracket acquire release use =
+    JSM $ generalBracket
+      (unJSM acquire)
+      (\resource exitCase -> unJSM $ release resource exitCase)
+      (unJSM . syncAfter . use)
+#endif
 
 #endif
 
