GCC 4.7 and fix compilation errors