Changed interface of RebalanceDataset to take number of intended chunks instead of computing it by itself.