Tweaks to fix compilation errors for MSVC 2010

Just a few casts that visual studio didn't like.