Fixed bug in metrics indexing