TimeSerie: Fix and improvement

* TS entries where not indexed by type (only id)
* Indexing is only performed once