Rewrote database tests