Working on Loop tests with C++ API test data

The testing is catching subtle bugs I introduced. I'm gaining a better
understanding of the library.