removed some superfluous casts