Fixes for #81811 and #82025.