Fixed db stuff