Fixes to database loading and saving in order to translate it.

(Code reviewed by connie :)