Fix errors when validation fails