Cherry pick fixes from 6.1.x