Add casts to avoid warnings.