Fix case where not all samples are read out.