MSINM-88: Fix StackOverflow exceptions in legacy MSI import