Fixed polyline for getting the index at the end of the line.