Fixed compiling on GCC and all related warnings.