Remove needless cast

Because it disables wrong type check by compiler.