fix several migration issues