Fixed warnings compiling in Visual Studio

 Fixed multiple compilation warnings and errors trying to compile in Visual Studio