Fix compile errors with GCC 4.7.2