Fix bug when saving index. Works well for 2G test.