VC++ compilation fixes