Fix counting number of vertices