Handling of returned C objects; hacked in, needs cleanup.