Get rid of use of expand_indices in the caching; all the tests still pass