Partly revert cb7eb674accd24b6b73f26ef23cf4a301b6ebfaf

Fixes #13911