Backport 2ff095ea0b0c05fbf6cc332eeadf26cfeb9e69f7