Correcting non-manifold edges