Fix some bugs in search tree.