Fix connection algorithm for rectilinear infill as sometimes it wasn't connecting segments correctly