Fixed BST checker