DF-2337. Fix file existence checking