Improve flow of hotfix branch-switching logic