Fix geometry

Fixes overlapping errors, duplicate points, unclosed polygons and gaps between polygon edges.