Fix PR8854. Track inserted copies to avoid read before write. Sorry, it's hard to...