CXX-238 fixes and additional tests