fix some issues with sparse reductions