Fixed some bugs, can't commit DB yet(used by another process)