Fix a mistake in group_dataset_by_steps, that screws with the timestamp iterator