Fix bug in DB class