node collapsing bug fixes