[1.5.x] Fixed a rest mistake I introduced in d5ce2ff.

Backport of 753edfa4b5 from master