Changed node removal code to avoid unnecessary error messages due to id removal.