Fix comparison errors signed/unsigned.
Add sparse support for distance-to-sphere.
Fix log filenames.