Add tests to verify. Fix error reporting in verify.