Get rid of the double casts.