Fixes to compile in C++