Validation pass zero

Here is a fix with tests for bug #9.

The first commit is the failing tests, and the second is the fix.