fixed MSVC 2013 warnings and errors