Fix detection of remote files