fix an implicit cast to float