Add removal of dead references