bug:16450675 Avoid using unsigned ints in math with negative numbers Change-Id: Icdfb72451f03380dbf78b3703793869b2cd4e751