Bug fix in migration