diff --git a/darcs-beta.cabal b/darcs-beta.cabal
--- a/darcs-beta.cabal
+++ b/darcs-beta.cabal
@@ -1,5 +1,5 @@
 Name:           darcs-beta
-version:        2.2.98.2
+version:        2.2.98.3
 License:        GPL
 License-file:   COPYING
 Author:         David Roundy <droundy@darcs.net>, <darcs-users@darcs.net>
@@ -318,7 +318,7 @@
                    html         == 1.0.*,
                    filepath     == 1.1.*,
                    haskeline    >= 0.6.1 && < 0.7,
-                   hashed-storage >= 0.3.4 && < 0.4
+                   hashed-storage >= 0.3.5 && < 0.4
 
   if !os(windows)
     build-depends: unix >= 1.0 && < 2.4
@@ -451,7 +451,7 @@
                    html         == 1.0.*,
                    filepath     == 1.1.*,
                    haskeline    >= 0.6.1 && < 0.7,
-                   hashed-storage >= 0.3.4 && < 0.4
+                   hashed-storage >= 0.3.5 && < 0.4
 
   if !os(windows)
     build-depends: unix >= 1.0 && < 2.4
diff --git a/release/distributed-context b/release/distributed-context
--- a/release/distributed-context
+++ b/release/distributed-context
@@ -1,1 +1,1 @@
-Just "\nContext:\n\n[TAG 2.2.98.2\nPetr Rockai <me@mornfall.net>**20090709104304\n Ignore-this: d9832c9f7b7c2c78ae83fda2524162ca\n] \n"
+Just "\nContext:\n\n[TAG 2.2.98.3\nPetr Rockai <me@mornfall.net>**20090710143916\n Ignore-this: 58721594f0f0779473e3e88e9fc4bb29\n] \n"
diff --git a/src/Darcs/Gorsvet.hs b/src/Darcs/Gorsvet.hs
--- a/src/Darcs/Gorsvet.hs
+++ b/src/Darcs/Gorsvet.hs
@@ -163,7 +163,8 @@
                    _ -> choose_touching pre_files pending
   return relevant
 
-applyToTree patch tree = snd `fmap` virtualTreeIO (apply [] patch) tree
+applyToTree :: (Apply p) => p -> Tree -> IO Tree
+applyToTree patch t = snd `fmap` virtualTreeIO (apply [] patch) t
 
 unrecordedChanges :: (RepoPatch p) => [DarcsFlag] -> Repository p C(r u t)
                   -> [SubPath] -> IO (FL Prim C(r y))
@@ -237,16 +238,18 @@
 
 readIndex :: (RepoPatch p) => Repository p C(r u t) -> IO Tree
 readIndex repo = do
-  let getpris = readRecordedAndPending repo
-      update = do pris <- getpris >>= expand
-                  I.updateIndexFrom "_darcs/index" darcsTreeHash pris
   invalid <- doesFileExist "_darcs/index_invalid"
   exist <- doesFileExist "_darcs/index"
-  if (not exist || invalid)
-     then do idx <- update
+  format_valid <- if exist
+                     then I.indexFormatValid "_darcs/index"
+                     else return True
+  when (exist && not format_valid) $ removeFile "_darcs/index"
+  if (not exist || invalid || not format_valid)
+     then do pris <- readRecordedAndPending repo
+             idx <- I.updateIndexFrom "_darcs/index" darcsTreeHash pris
              when invalid $ removeFile "_darcs/index_invalid"
              return idx
-     else I.readOrUpgradeIndex "_darcs/index" darcsTreeHash getpris
+     else I.readIndex "_darcs/index" darcsTreeHash
 
 invalidateIndex :: t -> IO ()
 invalidateIndex _ = do
