Fixed merged record list creation to not miss some IDs.