Fix bug for migration.