Fix migration problems (duplicates)