Added check for 0-length polygons in intersection shapes