Fixed database tests