index maintenance tasks. fixes #394