bug fix in bst decode