fix implicit cast warnings