Fixes for #81911 and #82025.