Edge: bug fix in distance to segment computation