Fix branch collapsing