Corrected bug in dataset selection