Fix crash in clearCachedCatalogs