Remove redundant casts