Removing 0-distance shifts, which are problematic under our current JIT. Also moving error reporting around, so that the root problems are reported first.