1.6 isn't under development any more.

Partial forward port of a71ff76 from stable/1.6.x.