Fix a bunch of compilation issues.