ticket_branch: bug fixes and speedup