Remove unnecessary casts.