Fix a bunch of compilation issues, what was I thinking