Fix GCC compilation warnings and errors.