Fix most validity errors.

svn path=/trunk/tools/; revision=83602