[OE-4588] Fix bugs in updating measurement references.
[OE-4584] Add dummy references for unattached measurements.