Fix bug with collapsing/uncollapsing nodes when expanded is 'true'.