Fix migration issues