write gaia basic tree test case and fix some bugs.