Remove useless casts and memset.