Corrected bug in indexing items

Fixes #50.