[1.7.x] Fixed a few warnings in the testsuite.

Backport of 536ebaa048f69c18aa36448074f65f2741e35df5 from master.