diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,9 @@
 
+Version 5.2
+-----
+
+* Using the mwc-random package for generating random numbers by default.
+
 Version 5.1
 -----
 
diff --git a/Simulation/Aivika/IO/Generator.hs b/Simulation/Aivika/IO/Generator.hs
--- a/Simulation/Aivika/IO/Generator.hs
+++ b/Simulation/Aivika/IO/Generator.hs
@@ -14,12 +14,14 @@
 --
 module Simulation.Aivika.IO.Generator () where
 
+import System.Random
+import qualified System.Random.MWC as MWC
+
 import Control.Monad
 import Control.Monad.Trans
 
-import System.Random
-
 import Data.IORef
+import Data.Vector
 
 import Simulation.Aivika.Trans.Generator
 import Simulation.Aivika.Trans.Generator.Primitive
@@ -84,9 +86,9 @@
   newGenerator tp =
     case tp of
       SimpleGenerator ->
-        liftIO newStdGen >>= newRandomGenerator
+        MWC.uniform <$> MWC.withSystemRandom (return :: MWC.GenIO -> IO MWC.GenIO) >>= newRandomGenerator01
       SimpleGeneratorWithSeed x ->
-        newRandomGenerator $ mkStdGen x
+        MWC.uniform <$> MWC.initialize (singleton x) >>= newRandomGenerator01
       CustomGenerator g ->
         g
       CustomGenerator01 g ->
diff --git a/Simulation/Aivika/Trans/Generator.hs b/Simulation/Aivika/Trans/Generator.hs
--- a/Simulation/Aivika/Trans/Generator.hs
+++ b/Simulation/Aivika/Trans/Generator.hs
@@ -17,6 +17,7 @@
         DiscretePDF(..)) where
 
 import System.Random
+import Data.Word
 
 import Simulation.Aivika.Generator (DiscretePDF)
 
@@ -100,7 +101,7 @@
 -- | Defines a type of the random number generator.
 data GeneratorType m = SimpleGenerator
                        -- ^ The simple random number generator.
-                     | SimpleGeneratorWithSeed Int
+                     | SimpleGeneratorWithSeed Word32
                        -- ^ The simple random number generator with the specified seed.
                      | CustomGenerator (m (Generator m))
                        -- ^ The custom random number generator.
diff --git a/Simulation/Aivika/Trans/Generator/Primitive.hs b/Simulation/Aivika/Trans/Generator/Primitive.hs
--- a/Simulation/Aivika/Trans/Generator/Primitive.hs
+++ b/Simulation/Aivika/Trans/Generator/Primitive.hs
@@ -42,9 +42,15 @@
 {-# INLINE generateUniformInt01 #-}
 generateUniformInt01 g min max =
   do x <- g
-     let min' = fromIntegral min
-         max' = fromIntegral max
-     return $ round (min' + x * (max' - min'))
+     let min' = fromIntegral min - 0.5
+         max' = fromIntegral max + 0.5
+         z    = round (min' + x * (max' - min'))
+         z'   = if z < min
+                then min
+                else if z > max
+                     then max
+                     else z
+     return z'
 
 -- | Generate the triangular random number by the specified minimum, median and maximum.
 generateTriangular01 :: Monad m
diff --git a/Simulation/Aivika/Trans/Parameter/Random.hs b/Simulation/Aivika/Trans/Parameter/Random.hs
--- a/Simulation/Aivika/Trans/Parameter/Random.hs
+++ b/Simulation/Aivika/Trans/Parameter/Random.hs
@@ -36,8 +36,6 @@
         randomTrue,
         randomFalse) where
 
-import System.Random
-
 import Control.Monad.Trans
 
 import Simulation.Aivika.Trans.Generator
diff --git a/aivika-transformers.cabal b/aivika-transformers.cabal
--- a/aivika-transformers.cabal
+++ b/aivika-transformers.cabal
@@ -1,18 +1,18 @@
 name:            aivika-transformers
-version:         5.1
+version:         5.2
 synopsis:        Transformers for the Aivika simulation library
 description:
     This package is a generalization of the aivika [1] simulation library
     with extensive use of monad transformers and type families.
     It can be applied for nested simulation [2] and parallel distributed simulation [3].
     .
-    Unlike sequential simulation, the distribution simulation is more difficult for implementing
+    Unlike sequential simulation, the distributed simulation is more difficult for implementing
     the simulation experiments by the Monte-Carlo method. Therefore, there are additional packages
-    that allow saving the results of distribution simulation in SQL databases
+    that allow saving the results of distributed simulation in SQL databases
     and only then the simulation reports are generated. These reports are HTML pages
     with charts, histograms, links to CSV tables, statistics summary and so on.
     .
-    This method can be used not only for the parallel distribution simulation, but also for other 
+    This method can be used not only for the parallel distributed simulation, but also for other 
     simulation models created with help of the generalized version of the Aivika simulation library.
     Please consult the AivikaSoft [4] website for more details.
     .
@@ -170,8 +170,9 @@
                      array >= 0.3.0.0,
                      containers >= 0.4.0.0,
                      random >= 1.0.0.3,
+                     mwc-random >= 0.13.0.0,
                      vector >= 0.10.0.1,
-                     aivika >= 5.1
+                     aivika >= 5.2
 
     other-extensions:   FlexibleContexts,
                         FlexibleInstances,
