Merged `parser.clean()` fix (issue #16820) from 3.2 through 3.3.