Fix mistake in end_time calculation for scan transformation