Same as #2967 but on 4.1 branch
Merge pull request #3401 from hannesvdvreken/patch-1

Same as #2967 but on 4.1 branch