fix bug in migrated paths transformation and add more comprehensive tests