Fixed a bug which prints out empty root node