Cherry pick commits from 1.6 branch on master