Backport of 5298d0b7b550dfaba884cf83b3b8178d510c39f7