Review/msvc fixes

Some changes to fix builds on MSVC 2010.