Fix the spec, add some tests