Fixing index out of bounds exception in CollectTargetedPcrMetrics