are these casts really necessary? i.e. are the proper types not available for the compiler without our help?