fixes to db.go