Fix validity logic. Likely going to bed now; school tomorrow and it's
late.