Correcting a bug in the case of vertices of degree <3