Fixing duplicatas and database.