Fix bug with indices
Merge pull request #1005 from alekcac:doc_fix