Updated db script and fixed tests.