correct casts

Change-Id: Ib74e924663c91be09d96e9e25e011e578656a6a0