Fix warning in implicit cast