Fix problem getting leafnos for single-segment geometries.