Added new test program and fixed an error in printing root nodes.