small db fixes