Fix implicit cast warnings