Backport to 1.5.2.