Make sure triangles have only three vertices.