Fixed bug with nested root nodes