Add fix from #16413

Fixes #16413