Adds some validation code.