fixed index cleanup when last records with such index removed