Merge "Fix unsigned integer overflow of i, which gives SIGABRT" am: 8db23af93b am: 1886fb446c am: 50b893ed6a

Change-Id: I98b2edd992c56bf2242258d7d137cf4d2f90df9d