Fixing some problems with the database.