Fix debug test crashes from bad C++ asserts