Fix some compilation errors on gcc