Fix GCC errors and warnings.