Fixed bug in comparing root with chield.