Fix a bug with populateItemLinks remove:
The identifiers should be removed before ids removed,
which cause element not found exception otherwise.