Don't overwrite ciidx if it is already set.
Merge pull request #831 from carsonmcdonald/ciidxfix

Don't overwrite ciidx if it is already set.