fixed null reference exception bug in PopulateTree from ecma