explicit casts to avoid warnings