backport changes to fix tests
merge 0.10