Fixed a lot of issues with polygons