fixed a bug where automerge would cause the mesh to collapse

reported by Ian Lloyd Costa Dela Cruz