Merge "Fix signedness mismatch and integer underflow"
am: b46a2f7dea

Change-Id: Ie2fcbf4af0ae882d67e7ecdbaf7db56b68eabf36