Fixed branch bugs