fixed compile warnings and errors in Visual Studio