Revert "Merge pull request #17161 from pivanov/bug-968483" for regressions

This reverts commit a71c4bf0a0e8ef949b6c03cac1e3be1d957f126e, reversing
changes made to ea9e23abea5933656555d849b922c8da7530c90b.