Fix metadata caching and add indexer