This typecast shouldn't be needed here.  Do you get errors without it?