Fix compilation errors and warnings on Linux with GCC.