Fix many-to-many handling when multiple links were created during the same tx
Fix typo