issue #886 - no objects on 2nd pass crashes add_relate_measurement. Fix + test