Backport test fixes

Backport test fixes needed for 1.8.0 release.

Closes #3669.