Fix bug when the combined package DB has duplicate package IDs