Small fixes in db.c.