Bugfix: don't re-assign IDs when already present