Correct firstinvalid attribute