Fix bug in cherry-pick tool