MapWriter/#332: fix to invalid polygons