Fixup branch checkout logic