Fixed compile errors for g++