Fix virtual libraries template function

The virtual libraries template function was overriding the cache used
for format_metadata in the ProxyMetadata object.