Fix sample index