Fix id of dangling reference