Fix logic with remote files.