Bug fixes. Added a cache of the computed indices for compression of a grid.