Removes unnecessary casts (adapts to SDK 0.8.7).