backport 7 fixes