fix reference update on delete
Merge pull request #71 from flyvictor/delete-unlinking

fix reference update on delete