Fix bugs in handling files / directories that are not readable