Fix msvc9 compile errors