Store: fix some concurrency issues