correctly handle '~' in the paths in second and later files.