Fixed some cherry-pick merge errors