the const_cast is no longer necessary

Change-Id: I802fd594660761e5ee112fa096f6f4c8fcc97cbb
coverity#1219811 dereference null return value

Change-Id: I2cff394e32ce6bc7bf39fae09d91a9730ad8f656
coverity#1219654 avoid possible out-of-bounds access

Change-Id: I44de7037a9e3a65b539f452aace782683121ba83