Fixed issues with branching