Fixing bug in branch selection.