Fixed selfintersection bug.