fix some issues with tests and databases