diff --git a/Tools/TimePlot.hs b/Tools/TimePlot.hs
--- a/Tools/TimePlot.hs
+++ b/Tools/TimePlot.hs
@@ -248,9 +248,9 @@
           | f x <= f y = x : mergeOn f xs (y:ys)
           | otherwise  = y : mergeOn f (x:xs) ys                      
 
-    timeBounds     = (head times, last times)
-    times          = sort $ [t | tes <- M.elems track2events, (t,_)<- tes]
-    commonTimeAxis = autoAxis times
+    (minTime,maxTime) = (head times, last times)
+    times             = sort $ [t | tes <- M.elems track2events, (t,_)<- tes]
+    commonTimeAxis    = autoAxis times
 
     plotTrack      name es = plotWithKind name (chartKindF name) es
 
@@ -357,7 +357,7 @@
                    plot_points_style  ^= hollowCircles 4 1 (opaque blue) $ 
                    defaultPlotPoints
 
-    plotTrackCumSum name es = plotLines name $ scanl1 (\(t1,s) (t2,v) -> (t2,s+v)) (values es)
+    plotTrackCumSum name es = plotLines name $ scanl (\(t1,s) (t2,v) -> (t2,s+v)) (minTime, 0) (values es)
 
     plotTrackSum name es bs = plotLines name $ byTimeBins sum bs t0 (values es)
 
@@ -372,7 +372,7 @@
         defaultLayout1
 
 edges2durations :: forall t. (Ord t, HasDelta t) => [(t,Edge)] -> [(t,InEvent)]
-edges2durations tes = [(t1, InValue $ toSeconds (t2 `sub` t1) (undefined::t)) | LongEvent t1 t2 _ <- edges2events tes]
+edges2durations tes = [(t2, InValue $ toSeconds (t2 `sub` t1) (undefined::t)) | LongEvent t1 t2 _ <- edges2events tes]
 
 edges2events :: (Ord t) => [(t,Edge)] -> [Event t Status]
 edges2events tes = longs `merge` pulses
@@ -386,11 +386,16 @@
     edges  = [(t,e) | (t,e) <- tes, e /= Pulse]
     longs  = longs' (Status "") Nothing 0 (error "Unreachable") edges
       where
+        -- arg 1: current status
+        -- arg 2: start time of bar or nothing
+        -- arg 3: bar height
+        -- arg 4: ???
+        -- arg 5: events
         longs' s _         0 _ [] = []
         longs' s (Just t0) _ t [] = [LongEvent t0 t s]
         longs' s Nothing   0 _ ((t,Rise):tes) = longs' s (Just t)  1 t tes
         longs' s Nothing   0 _ ((t,Fall):tes) = longs' s Nothing   0 t tes
-        longs' s (Just t0) n _ ((t,Rise):tes) = longs' s (Just t0) 1 t tes
+        longs' s (Just t0) n _ ((t,Rise):tes) = longs' s (Just t0) (n+1) t tes
         longs' s (Just t0) 1 _ ((t,Fall):tes) = LongEvent t0 t s : longs' s Nothing 0 t tes
         longs' s (Just t0) n _ ((t,Fall):tes) = longs' s (Just t0) (n-1) t tes
         longs' s Nothing   0 _ ((t,SetTo s'):tes) = longs' s' (Just t) 1 t tes
diff --git a/timeplot.cabal b/timeplot.cabal
--- a/timeplot.cabal
+++ b/timeplot.cabal
@@ -1,5 +1,5 @@
 Name: timeplot
-Version: 0.2.9
+Version: 0.2.10
 License: BSD3
 License-file: LICENSE
 Copyright: Eugene Kirpichov, 2009
