fix nasty looping problem when calculating complete_result_document for an owned container
Merge remote-tracking branch 'upstream/master'