C++ Client fixes

Fixes abort crash, client reference cycle, and a few other minor things