Used backported sparse_min_max from utils.fixes