Correct multipolygonstopolygon function