[#539] fixed various index not being properly cleared/used

fully working now !