Deletes unsed references