We need to guard this function from old values too, not just the changes to our uncommitted values down below. store_state() looks like it tramples over whatever's there.