Fix SQL database tests