Repairing topological errors via topological editing