Fixed errors with validation.

I don't know how this was ever working properly. :/