Issue #87. Complete incomplete tests.
Changes in db package.