Yeah, this is why I really like this way of doing things.  We just fix the parsed structure and everything is good.  replace_references just converts the structure to a string so we can save the updated content.   Basic rendering is just converting the structure (an ObjectContent thing) to a string.