Fixed a bug in database initialization.