Backport #1792 to 2.3

And finally the backport :)