Fixes part of #8514.
This should help developers to figure out what's going on when the sanitizer strips some input. Fixes #8522.