cherry-picked stuff from master into 1.5 branch