Fixed some issues in closestVertex

...but some issues remain in closestEdge