Remove redundant pointer casts