Fixes errors in the validation logic.