fix errors when removing all vertices