fix nasty looping problem when calculating complete_result_document for an owned container