Added support for empty catalogs and catalogs with only one file