Some consistency fixes in db.js.