Fixed error and warnings generated by Visual Studio