Fix a bug when creating database.