fix compilation errors on gcc