Merge "Fix two IndexOutOfBoundsException crashes." into oc-dev am: ded5608f18
am: 5caa419730

Change-Id: I9f26b5fbe8842d08e575720e3637ea890b157ede