Fix warnings and errors when compiling with GCC.