correction for changes to code generation
Start tying the validation code into a more coherent whole.