more backport of 3.2 fixes
more backports from 3.2