Fix removePolylines and removePolygons