test suite improvements for the DB portion, plus minor fixes.