suppressed some warnings by doing explicit casts

I prefer to have warnings enabled than suppressing them via the compiler flag