Fix bug when comparing IR samples with quality file samples that are out of order