Merge "Centralize bounds checking and don't overflow" am: fc9b8b8f0d
am: d63d621174

Change-Id: Ibaffded09b734e119c5cbf9abb968f0b02b4b22f