Fixed compile errors on g++