Fixed some migration bugs.