Improve metadata performance for tests with and without metadata.