a few fixes for the database refactoring