Fix warnings when listing unknown directory and when the directory to list is not set