Some minor improvements in the database handling from the recent experiment.
Related to #41 (closed).