Fixed tree test to deal with graphs that don't allow id assignment.