Pass a variable to cleanup nodes.

Change-Id: I4d8189a3547a6c0c57638c50bdd5fe57d6d48621