Fix ordering of branches for merge