adding explicit casts to clean up warnings