Db test and fix. (wip)