fix redundant casts