Fixed branching bug