fixed gcc-4.7 warnings - sadly when compiled with gcc-4.7 it still doesn't work as expected (the gcc-4.4 does)