Attempt to make the assignment of duplicationId actually work: since new copies are
not always made from the latest copy, we need to use a global counter of how
many duplicates there already are.