Fixed db connection problems.