Merge "Add casts to avoid errors due to narrowing"
am: 4556cb9cb8

Change-Id: I4cb4a7dace03c7c09403588da05ea8df0f35077e