Fixed caching issue, faster sparsification.