fix unconnected regions and stray tunnels