Fix the validation display

Rewrite the changes from commit 4785c85 to work with validation.