Making sure that we sort on the correct id. Closes #148