Don't overwrite ciidx if it is already set.

Once set it looks like ciidx shouldn't be overwritten. This fixes issue #724