Minor db improvements