diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,11 @@
 
+Version 5.4
+-----
+
+* A more correct treating of the stop time. Earlier, the final
+  integration time point was used instead of the stop time in
+  some functions.
+
 Version 5.3.1
 -----
 
diff --git a/Simulation/Aivika/Trans/Internal/Dynamics.hs b/Simulation/Aivika/Trans/Internal/Dynamics.hs
--- a/Simulation/Aivika/Trans/Internal/Dynamics.hs
+++ b/Simulation/Aivika/Trans/Internal/Dynamics.hs
@@ -70,7 +70,7 @@
 runDynamicsInStopTime :: Dynamics m a -> Simulation m a
 {-# INLINABLE runDynamicsInStopTime #-}
 runDynamicsInStopTime (Dynamics m) =
-  Simulation $ m . integStopPoint
+  Simulation $ m . simulationStopPoint
 
 -- | Run the 'Dynamics' computation in all integration time points.
 runDynamicsInIntegTimes :: Monad m => Dynamics m a -> Simulation m [m a]
diff --git a/Simulation/Aivika/Trans/Internal/Event.hs b/Simulation/Aivika/Trans/Internal/Event.hs
--- a/Simulation/Aivika/Trans/Internal/Event.hs
+++ b/Simulation/Aivika/Trans/Internal/Event.hs
@@ -220,7 +220,7 @@
 {-# INLINABLE enqueueEventWithStopTime #-}
 enqueueEventWithStopTime e =
   Event $ \p ->
-  let p0 = integStopPoint $ pointRun p
+  let p0 = simulationStopPoint $ pointRun p
   in invokeEvent p $ enqueueEventWithPoints [p0] e
 
 -- | It allows cancelling the event.
@@ -393,5 +393,5 @@
 {-# INLINABLE enqueueEventIOWithStopTime #-}
 enqueueEventIOWithStopTime e =
   Event $ \p ->
-  let p0 = integStopPoint $ pointRun p
+  let p0 = simulationStopPoint $ pointRun p
   in invokeEvent p $ enqueueEventIOWithPoints [p0] e
diff --git a/Simulation/Aivika/Trans/Internal/Specs.hs b/Simulation/Aivika/Trans/Internal/Specs.hs
--- a/Simulation/Aivika/Trans/Internal/Specs.hs
+++ b/Simulation/Aivika/Trans/Internal/Specs.hs
@@ -27,6 +27,7 @@
         integPointsStartingFrom,
         integStartPoint,
         integStopPoint,
+        simulationStopPoint,
         timeGrid,
         pointAt) where
 
@@ -136,7 +137,7 @@
                            pointIteration = n,
                            pointPhase = 0 }
 
--- | Return the stop time point.
+-- | Return the integration stop time point.
 integStopPoint :: Run m -> Point m
 integStopPoint r = point nu
   where sc = runSpecs r
@@ -146,6 +147,10 @@
                            pointTime = basicTime sc n 0,
                            pointIteration = n,
                            pointPhase = 0 }
+
+-- | Return the simulation stop time point.
+simulationStopPoint :: Run m -> Point m
+simulationStopPoint r = pointAt r (spcStopTime $ runSpecs r)
 
 -- | Return the point at the specified time.
 pointAt :: Run m -> Double -> Point m
diff --git a/aivika-transformers.cabal b/aivika-transformers.cabal
--- a/aivika-transformers.cabal
+++ b/aivika-transformers.cabal
@@ -1,5 +1,5 @@
 name:            aivika-transformers
-version:         5.3.1
+version:         5.4
 synopsis:        Transformers for the Aivika simulation library
 description:
     This package is a generalization of the aivika [1] simulation library
@@ -175,7 +175,7 @@
                      random >= 1.0.0.3,
                      mwc-random >= 0.13.0.0,
                      vector >= 0.10.0.1,
-                     aivika >= 5.3.1
+                     aivika >= 5.4
 
     other-extensions:   FlexibleContexts,
                         FlexibleInstances,
