diff --git a/Simulation/Aivika/Agent.hs b/Simulation/Aivika/Agent.hs
--- a/Simulation/Aivika/Agent.hs
+++ b/Simulation/Aivika/Agent.hs
@@ -211,7 +211,7 @@
          "Use the setStateTransition function to define " ++
          "the transition state: activateState."
        ProcessingMode ->
-         do x0 @ (Just st0) <- readIORef (agentStateRef agent)
+         do x0@(Just st0) <- readIORef (agentStateRef agent)
             invokeEvent p $ traversePath x0 st
 
 -- | Set the activation computation for the specified state.
diff --git a/Simulation/Aivika/DoubleLinkedList.hs b/Simulation/Aivika/DoubleLinkedList.hs
--- a/Simulation/Aivika/DoubleLinkedList.hs
+++ b/Simulation/Aivika/DoubleLinkedList.hs
@@ -201,10 +201,10 @@
                              (Nothing, Nothing) ->
                                do writeIORef (listHead x) Nothing
                                   writeIORef (listTail x) Nothing
-                             (Nothing, head' @ (Just item')) ->
+                             (Nothing, head'@(Just item')) ->
                                do writeIORef (itemPrev item') Nothing
                                   writeIORef (listHead x) head'
-                             (tail' @ (Just item'), Nothing) ->
+                             (tail'@(Just item'), Nothing) ->
                                do writeIORef (itemNext item') Nothing
                                   writeIORef (listTail x) tail'
                              (Just prev', Just next') ->
diff --git a/Simulation/Aivika/Generator.hs b/Simulation/Aivika/Generator.hs
--- a/Simulation/Aivika/Generator.hs
+++ b/Simulation/Aivika/Generator.hs
@@ -318,7 +318,7 @@
 newGenerator tp =
   case tp of
     SimpleGenerator ->
-      MWC.uniform <$> MWC.withSystemRandom (return :: MWC.GenIO -> IO MWC.GenIO) >>= newRandomGenerator01
+      MWC.uniform <$> MWC.createSystemRandom >>= newRandomGenerator01
     SimpleGeneratorWithSeed x ->
       MWC.uniform <$> MWC.initialize (singleton x) >>= newRandomGenerator01
     CustomGenerator g ->
diff --git a/Simulation/Aivika/Internal/Cont.hs b/Simulation/Aivika/Internal/Cont.hs
--- a/Simulation/Aivika/Internal/Cont.hs
+++ b/Simulation/Aivika/Internal/Cont.hs
@@ -777,7 +777,7 @@
           writeIORef rc Nothing
           case c of
             Nothing -> return Nothing
-            z @ (Just c) ->
+            z@(Just c) ->
               do f <- invokeEvent p $
                       contPreemptionBegun $
                       contId $ contAux c
diff --git a/Simulation/Aivika/Stream.hs b/Simulation/Aivika/Stream.hs
--- a/Simulation/Aivika/Stream.hs
+++ b/Simulation/Aivika/Stream.hs
@@ -289,7 +289,7 @@
 
 -- | Replace the 'Left' values.
 replaceLeftStream :: Stream (Either a b) -> Stream c -> Stream (Either c b)
-replaceLeftStream (Cons sab) (ys0 @ ~(Cons sc)) = Cons z where
+replaceLeftStream (Cons sab) (ys0@(Cons sc)) = Cons z where
   z = do (a, xs) <- sab
          case a of
            Left _ ->
@@ -300,7 +300,7 @@
 
 -- | Replace the 'Right' values.
 replaceRightStream :: Stream (Either a b) -> Stream c -> Stream (Either a c)
-replaceRightStream (Cons sab) (ys0 @ ~(Cons sc)) = Cons z where
+replaceRightStream (Cons sab) (ys0@(Cons sc)) = Cons z where
   z = do (a, xs) <- sab
          case a of
            Right _ ->
diff --git a/aivika.cabal b/aivika.cabal
--- a/aivika.cabal
+++ b/aivika.cabal
@@ -1,5 +1,5 @@
 name:            aivika
-version:         5.9
+version:         5.9.1
 synopsis:        A multi-method simulation library
 description:
     Aivika is a discrete event simulation (DES) framework with support of activity-oriented,
@@ -235,7 +235,7 @@
                      array >= 0.3.0.0,
                      containers >= 0.4.0.0,
                      random >= 1.0.0.3,
-                     mwc-random >= 0.13.0.0,
+                     mwc-random >= 0.13.1.0,
                      vector >= 0.10.0.1,
                      deepseq >= 1.1.0.0,
                      binary >= 0.6.4.0,
