Fix compile errors with GCC 4.7