Fix error when deleting a triangle vertex

Fixes #1712