cherry-pick commits from master