Make ResultBuilder's "indexed mode" work consistently.

This should largely prevent the nasty fatal errors
we got from API calls with XML format.

Change-Id: Ie06743e5409e5fa0d469b4506871bb9b760f6eda
Merge "Make ResultBuilder's "indexed mode" work consistently."