This reverts commit fbbc4a4979b256125d2238f6325ad86e7f1b58bd, reversing changes made to f254e383859a2939d5929346f6595549f424f7c5. Fixes #7851