Cherry pick some changes manually from master