Fixed broken code with Linux

It was tested wit Linux CodeBlocks 10.05 GCC 4.7.2,
Windows CodeBlocks 12.11 MinGW32-g++ 4.7.1 and
Visual Studio 2012