Fixes in the migration tools and sub data migration