Fix cast operation