Fixed DB tests.
Fixed DB and Sphinx tests.