Better handling of directories and inaccessible files.