Minimal changes to allow compilation in Visual Studio

If you are interested, this changes allow compilation in Visual Studio and I think are not going to break Linux (I haven't tested the code)