This partially reverts 25de7aa7. Fixes #14473. (cherry picked from commit 7a182f10)
mentioned in commit 26132003