Remove unnecessary pointer casts