deleting, closing, reopening indices. fixes #401, #402