Added some data base checking code via tests.