Fix btree bugs.