Account for synthetic indexing of collections.

Fixes issue #198. Thanks for the patch!