Fix warnings and errors on gcc.