Rewrite validation and test to ensure coverage.