fixed two off-by-one errors in calculation of timeslice index