Fix bad typo; improve tests to actually exercise database.