Fixes #27120 Fixes #34989
This resolves the patch issues. If someone has time, they should try to get the patched merged upstream.