Fixing some issues what database tests