Fix compile errors with g++ 4.8.