fix a nasty little bug where we weren't passing the right objects back to C++.