Cleanup code so it builds with C++ again