Fix automatic dataset logic