crash fix: use branch->SetAddress instead of leaf, consistent code arrangement