diff --git a/acid-state.cabal b/acid-state.cabal
--- a/acid-state.cabal
+++ b/acid-state.cabal
@@ -7,7 +7,7 @@
 -- The package version. See the Haskell package versioning policy
 -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
 -- standards guiding when and how versions should be incremented.
-Version:             0.6.5
+Version:             0.6.6
 
 -- A short (one-line) description of the package.
 Synopsis:            Add ACID guarantees to any serializable Haskell data structure.
diff --git a/examples/HelloDatabase.hs b/examples/HelloDatabase.hs
--- a/examples/HelloDatabase.hs
+++ b/examples/HelloDatabase.hs
@@ -32,9 +32,10 @@
 main :: IO ()
 main = do args <- getArgs
           database <- openLocalStateFrom "myDatabase/" (Database ["Welcome to the acid-state database."])
-          if null args
-            then do messages <- query database (ViewMessages 10)
-                    putStrLn "Last 10 messages:"
-                    mapM_ putStrLn [ "  " ++ message | message <- messages ]
-            else do update database (AddMessage (unwords args))
+          case args of
+            [] -> do messages <- query database (ViewMessages 10)
+                     putStrLn "Last 10 messages:"
+                     mapM_ putStrLn [ "  " ++ message | message <- messages ]
+            ["checkpoint"] -> createCheckpoint database
+	    _ -> do update database (AddMessage (unwords args))
                     putStrLn "Your message has been added to the database."
diff --git a/src/Data/Acid/Local.hs b/src/Data/Acid/Local.hs
--- a/src/Data/Acid/Local.hs
+++ b/src/Data/Acid/Local.hs
@@ -198,6 +198,7 @@
          eventsLog <- openFileLog eventsLogKey
          events <- readEntriesFrom eventsLog n
          mapM_ (runColdMethod core) events
+         ensureLeastEntryId eventsLog n
          checkpointsLog <- openFileLog checkpointsLogKey
          stateCopy <- newIORef undefined
          withCoreState core (writeIORef stateCopy)
diff --git a/src/Data/Acid/Log.hs b/src/Data/Acid/Log.hs
--- a/src/Data/Acid/Log.hs
+++ b/src/Data/Acid/Log.hs
@@ -10,6 +10,7 @@
     , closeFileLog
     , pushEntry
     , pushAction
+    , ensureLeastEntryId
     , readEntriesFrom
     , rollbackTo
     , rollbackWhile
@@ -152,6 +153,14 @@
               = entry : worker next
           worker (Fail msg) = error msg
 
+ensureLeastEntryId :: FileLog object -> EntryId -> IO ()
+ensureLeastEntryId fLog youngestEntry = do
+  atomically $ do
+    entryId <- readTVar (logNextEntryId fLog)
+    writeTVar (logNextEntryId fLog) (max entryId youngestEntry)
+  cutFileLog fLog
+  return ()
+
 -- Read all durable entries younger than the given EntryId.
 -- Note that entries written during or after this call won't
 -- be included in the returned list.
@@ -232,7 +241,7 @@
           | otherwise                       -- If 'left' starts after our maxEntryId then we're done.
           = []
         ltMinEntryId = case minEntryIdMb of Nothing         -> const False
-                                            Just minEntryId -> (< minEntryId)
+                                            Just minEntryId -> (<= minEntryId)
         ltMaxEntryId = case maxEntryIdMb of Nothing         -> const True
                                             Just maxEntryId -> (< maxEntryId)
         rangeStart (firstEntryId, _path) = firstEntryId
