Added valid casts to suppress warnings