Fix migration problems