Inverted polygons fixes (crashes, geometry checking, memory consuption, CPU efficiency)