This resolves some issues with the instance export dialog when the instances folder path contains '..' and '.', or involves symlinks.