Fixed the bug with layout going south after collapsing nodes