Backport #486 in 2.3 as well