Updated db_integrity_test function.