fix bug

- fix commutative operation
- remove unnecessary cast