#3714 for 3.6

Merge this one only on master please, I have a diferent pull request for master-2.5