Fixed the Validation bugs.

Fixed the Validation bugs.