Fixes #50.
Merge pull request #51 from Sparrho/issue-50

Corrected bug in indexing items