Issue #21645, #21985: Remove debug code