misc: Fix change endpoint bugs

 * Fix not accounting for old endpoint cardinality subtraction
 * Fix get model element instance primitive uri substring