We added support for kamailio-style branch flags into the sip-router core but didn't update the tm module. We will have to review the code in tm module and set/reset backup branch flags where appropriate. See where the kamailio version of tm module calls branch flag related functions.
The select implementation in the sip-router core has function reset_static_buffer, we might need to call this function from run_top_route. We need to check all occurrences of run_top_route and see whether the static buffer in selects need to be reset when the function is called.