C++ compile fixes, warning fixes, bugfixes.