I fixed the other problems, but the 64-bit ndr_marshall tests still crash. The problem there seems to be an insufficiently large buffer: If I increase StubMsg.BufferLength by even 1 byte in test_conf_complex_struct, the tests do not crash. This may be a preëxisting problem that just happens to occur more frequently after refactoring the code.