Fix multiple TestDocument problem. The baseline code add stuff to
indices multiple times. As I said, these code are not usable.