minor crash fixes, plus ability to fix 0-distance