Correct handling of missing files

Correct handling of non-existing files and directories, new signature of
predicate function.