Fixed bug in deleting index.