RenderthemeV4, #549: changed drawing order so that higher-priority items are drawn on top of lower priority items (thanks @ystsoi).
MapWriter/#332: fix to invalid polygons