Fixed a bug in the database storage.