[1.5.x] Fixed error in last commit. Thanks Simon Charette.

Backport of 6ef199a08e from master