Cleanup and fixes for C and C++.