fix bugs and tested BTree