Fixes a potential problem with deleting and recreating a sindex.

Fixes #657.
Merge branch 'next' into merge_br