Sparse fix for __leaf__ error.