Added warning when the polygon becomes invalid.