Fixed lots of warnings in MSVC++2010

Mostly just casts
Lots and lots of casts
Fixed additional MSVC++210 warnings