A few speed tweaks
Optimise sparse utils