Fix issue with isDirectory not set when the file does not exist.