Fix a bug that created 2 extra vertices in buildGeneralPolyLine