Is there a reason why error handling and create/free of buf can't be done inside mongo_collection_insert_opcode? I think we should do the error handling *inside* each method (by passing return_value) to make each wrapper method cleaner. I am going to do that for createIndex too.