Fixed race conditions in filetree update.