Fixed compilation errors. Compiling succesfuly with mingw32-gcc 4.8.1