Backport f9872568f464fdf074c730c441485c57e2f236b1