add exception handling to maintain the list of indexes correctly, fixes #252
Merge branch 'divergent'