Bug fix to avoid initializing the database more than once.