Fixed some bugs in avl_remove