Fixing bug related to buiding some indexes when the dataset is not passed in the constructor