Fixed compile problems in g++