GCC 4.7 compilation fixes