added casts to fix warnings