Fixed compilation errors on gcc