FACTOR: prevent crash if the dataset is empty.