Visual studio compilation fixes