Smarter validation; expanded tests.