Updated handling of remote files