Remove unnecessary casts