integrate upstream changes from 4.6 branch up to 98abd24