Added sanity check in sparsedataset