fix compile errors with g++ 4.7.2