Final pass at fixing #5785. Need to make sure that inner-nodes are detached before...