Remember collapsed lists when rebuilding the tree