Fix various GCC version-dependent compilation issues.