Fix broken build for Visual C++

Tested on Visual Studio 2013, mingw(gcc4.7.2),  cygwin(gcc4.8.3),  Ubuntu 12.04