Revert "Merge pull request #12267 from pivanov/bug-908241"

This reverts commit 400d5fec2f099397575ded3ef8544150a9b472c5, reversing
changes made to a894561828a3a00ea54fe69fad26f0cadf6239fa.