Fixed bug in handling of tertiary indexterms