Remove superfluous casts