Eliminating some warnings.

I guess I'm a little pedantic about warnings. Mostly it's just explicit casts, and commenting out of an unused variable.