Add optional third argument to bbtree-ref