Better bad variable handling in the bktree.