Add some casts to avoid warnings.