Fixes minor bug in getSelectedBranch