Fixed file exist checks.