Error detected: if there are 4 different intersections, (e.g. if two elements are outside of the rectangle and their connection crosses both corner points) the two intersections chosen for the inside line are the same ones and one intersection has been ignored. This is not the case anymore