Fix for finding closest intersection.