fix compile errors with g++ 4.7.2 -Wall -Werror