Fix error in db lib