Visual studio compatibility fixes