Add some explicit casts to fix -Wformat warnings.