Minor db fixes