Fix bug with SetPolygons