Fix branch bug