Fixing a bug of index6.
enriching error.
Fixing a bug of index6 for encoding.