Fix boundary conditions in pointSegment distance function.