bugfixes for edge collapse