Fixed some migration bugs.
Fixed minor bugs.